When Does Refresh Token Expires For Google Drive Api?
I just Started using Google Drive API using python to download File. I'm seeing it requires authentication for the first time and generates a token.pickle file. From next time onwa
Solution 1:
Refresh tokens shouldn't expire but they can.
- If the user removes your access though their Google account the refresh token will expire
- if the refresh token has not been used in six months it will expire.
- When you a user authenticates your application you get an access token and refresh token, if they authenticate your application again, you will get another access token and refresh token. You can have up to fifty refresh tokens for a users account and they will all work but after 50 the first one will expire.
Access tokens expire after an hour and you use the refresh token to request a new one.
Update for 2021
A Google Cloud Platform project with an OAuth consent screen configured for an external user type and a publishing status of "Testing" is issued a refresh token expiring in 7 days.
Solution 2:
If your app's publishing status is in 'Testing', then the token will last for 2 weeks only.
If its publishing status is 'in Production' then the token has no expiry. However if any sensitive scopes are there and not verified in your app, then the number of users also limited.
These are all tested but seems no official documentation is available yet.
Post a Comment for "When Does Refresh Token Expires For Google Drive Api?"