Sunday, March 12, 2023

Oauth2 Gmail refresh token expire problem

 Google said it's refresh token never expires:

"Note: The OAuth Playground does not store refresh tokens, but as refresh tokens never expire, user should go to their Google Account Authorized Access page if they would like to manually revoke them."

https://developers.google.com/oauthplayground/


However, for the personal project if the publish status is "Testing", it would expire in 7 days:


The following can be read from the Google document Using OAuth 2.0 to Access Google APIs, the section Refresh token expiration:

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.


https://stackoverflow.com/questions/8953983/do-google-refresh-tokens-expire 

The solution is to publish (ignore the requirement, no verification), so the publishing status is "In production", then it won't expire any more.


 

No comments:

Post a Comment