-
Notifications
You must be signed in to change notification settings - Fork 984
Description
I'm trying to use AuthState.performActionWithFreshTokens() to call a Google web service when my auth token has expired.
It seems that AuthState.performActionWithFreshTokens() uses the scope of the latest auth response and sends it to https://www.googleapis.com/oauth2/v4/token.
So when I do that, I get a Bad Request from v4/token because in the case of a token refresh, it doesn't expect a scope, as the documentation mentions: https://developers.google.com/identity/protocols/OAuth2InstalledApp#offline
I have tried to work around this by clearing the scope that is used by performActionWithFreshTokens() before refreshing my auth token, but the field is private so I can't override AuthState for this. Here is the code of my app: https://github.com/geekarist/who-am-i/blob/cdd5cf9cdfff02de02b6e8a467ea98e36e834a94/app/src/main/java/me/cpele/whoami/ProfileViewModel.kt#L31
Is there any other way?