Simon B.
Hi, we recently started using the OAuth2 Java API in order to migrate from GoogleAnalytics v2 API to v3. However, I just discovered that we never explicitly requested offline access as part of our process:
new GoogleAuthorizationCodeRequestUrl(CLIENT_ID, AUTH_URL, serviceScopes)
.setState(state)
.build();
However, we do receive refresh tokens when validating the authorization code:
GoogleTokenResponse response = new GoogleAuthorizationCodeTokenRequest(netHttpTransport, jacksonFactory,
CLIENT_ID, CLIENT_SECRET, authCode, AUTH_URL).execute();
response.getRefreshToken(); //Not null
Although I plan to fix the code for the offline access for future use, should we re-request new refresh-tokens, do they risk becoming invalid in any way the way they were created? With some of our tokens, we sometimes receive "invalid_grant" errors, but not all of them, could it be related or does it just mean the client revoked access? I though the fact that we do receive refresh-token indicated that we were granted offline access.
If it can have any impact our application is registered as an "Installed" application.
Thanks for any details/reassurance you could provide.