The refresh token is only issued once on the first request. If you requested the token once and already issued approval the second request for a code for token exchange will not return the refresh token. You can set the approval_prompt=force to force re-approval and hence reissue of the refresh token or you can revoke the token from the following UI, https://accounts.google.com/IssuedAuthSubTokens and then reissue the request.
On Wednesday, May 9, 2012 7:28:07 AM UTC-4, Yaniv Inbar wrote:
Would you kindly upgrade to 1.8.0-beta and try again? It won't fix the problem, but it may make it slightly easier to debug.
Another thing you can try is to enable logging and look if there is anything suspicious going on:
This works and I get an access token that works for a while. At some point that token expires and I need to refresh. It appears that my refresh token is good (ya29.AHES6ZRhvyWAx4z_8_uJnBuI6tEELZqBDdh54Ti6ydvb5f0), but the access.getAccessToken() returns null after a call to access.refresh(). Here is the code:
HttpTransport TRANSPORT = new NetHttpTransport();
JsonFactory JSON_FACTORY = new JacksonFactory();
GoogleAccessProtectedResource access = new GoogleAccessProtectedResource(parent.accessTokenGC,