Open PathTech opened 3 years ago
Had a similar issue when trying to handle the Sheets API. Make sure that in the InstalledAppFlow.from_client_secrets_file()
function you are using the same name as the file you downloaded from GCP. I just renamed that one to credentials.json
to match the code.
The sample code doesn't well explain the difference between token.json
and credentials.json
. credentials.json
comes from the file you download from GCP, while token.json
is generated from your code after referencing credentials.json
The refresh_token will only be provided with the first authorization from the user so any further authorization won't provide the refresh_token in the response. To solve this you can remove the app's access from the third-party apps here: https://myaccount.google.com/u/0/permissions this will cause the next authorization to return refresh_token
The refresh_token will only be provided with the first authorization from the user so any further authorization won't provide the refresh_token in the response. To solve this you can remove the app's access from the third-party apps here: https://myaccount.google.com/u/0/permissions this will cause the next authorization to return refresh_token
thank you bro it works
Expected Behavior
quickstart.py script will give me the last 10 login as described here: https://developers.google.com/admin-sdk/reports/v1/quickstart/python
Actual Behavior
I'm trying to run the quickstart.py with a downloaded token.json for Desktop apps.
It gives me the following erro:
Seems like the refresh_token is missing from my token.json. I've just generated the token.json.
Steps to Reproduce the Problem
Specifications
python --version
) Python 3.8.5