admin管理员组

文章数量:1123222

I’ve encountered an issue with Google OAuth where, after an access token refresh, the returned token sometimes lacks one of the originally granted scopes. This behavior affects only some users of our application.

Here's the flow:

  • Users grant access to all requested scopes, as confirmed in the OAuth consent response.
  • We validate the credential by successfully querying the Google Calendar API using the granted scope ().
  • The credentials are saved after passing all checks.

However, when the access token expires and we attempt to refresh it, the new token no longer includes the scope.

Before access token refresh:

 
.email 
.profile 
openid

After access token refresh:

.email 
.profile 
openid

This results in the loss of Calendar API functionality for affected users.

I've searched extensively, but haven't found documentation explaining why Google would return fewer scopes after a token refresh.

What could cause this behavior where certain scopes are excluded after token refresh?

本文标签: Google OAuth access token refresh returns fewer scopes than initially grantedStack Overflow