Search code examples
apioauthdrive

Google drive oauth api without having to have the user create an app in the Console?


Google Drive API question,

I am writing an application that can view a users' Google Drive files and folders from their google account (can be individual or part of an enterprise).

So on my Google Drive enterprise, I have created an API application. So I have an API key and Secret key stored in my application.

Now I want to use OAuth to authenticate the user so that they can approve my application to read their files. The users will not be part of my enterprise. They can be individual Google accounts, or they can be a single user from an some other enterprise account.

Is this possible? Or are there technical/security reasons this is not allowed?


Solution

  • I just got off the phone with wonderful Google api support agent, and I have my answer:

    Yes this is possible to do. however due to the recent phishing attack, Google has put in place new security features that affect the following APIs:

    • Google drive
    • Gmail
    • Contacts
    • Directory Admin SDK

    Here are the new rules:

    1. There is a new security form we will need to fill out and be approved before we will be able to be approved as a trusted app that is able to access these api's using OAuth2 authentication.

    2. Google has provided a feature that many enterprises use that allows an enterprise to completely disable the ability to access these api's using oauth2. So even though we have been approved from step1, we may still get an error for some enterprises who have directly blocked this; however, they can white list us in order to allow it from our enterprise if admin's prefer, while still blocking general use for others.

    See links:

    https://support.google.com/a/answer/7281227

    https://developers.google.com/drive/v3/web/about-auth

    https://developers.google.com/identity/protocols/OAuth2

    https://www.reddit.com/r/google/comments/692cr4/new_google_docs_phishing_scam_almost_undetectable/