Opening a file from Google Drive always requests offline access

I have an application for Google Drive that does not request offline access and is already installed and allowed by the user. If the application requests authorization on its own, there are no problems.

Recently, however, every time a file is opened from the Google Drive user interface, an authorization request appears:

This app would like to:
Have offline access

Detecting this request will still mean that it will appear the next time you open the file. I can see in the URL that Google Drive is generating what it requests for "access_type: offline". I do not see any settings in the cloud console to manage this and very confusing for users. How can this be prevented?

I see a number of similar questions, but not quite like that:

How do I disable OAuth2 offline access from connections initiated by the Google Drive SDK?

The second authorization with the same scope and autonomous panel access has an unexpected dialog with permission

"This application would like to: have offline access" when access_type = online

The application continues to request permission to "Access offline", why?

0
source share
1 answer

Looks like I found a solution for this. This message will be displayed if you do not do step 2 of the OAuth2 stream with the same client_id and client_secret.

@app.route('/open')
def drive_open_file():
    code = request.args.get('code')
    if code:
        credentials = credentials_from_code("client", "secret",
                               "https://www.googleapis.com/auth/drive.file",
                               code,
                               redirect_uri="<WEBSITE>/open")
0
source

All Articles