Receiving an "offline access" permission request when calling GoogleAuthUtil.getToken

I am trying to make user authorization my REST service from an Android device. After the first confirmation, everything works correctly, but if I want to get a new token from GoogleAuthUtil.getToken after clearing the old token using GoogleAuthUtil.clearToken , I get com.google.android.gms.auth.UserRecoverableAuthException: NeedPermission , which leads to the application consent screen with "have access to offline access . After I granted permission, I get a new token in onActivityResult or using GoogleAuthUtil.getToken , but if I clear the token again, I still get an Exception call that calls GoogleAuthUtil.getToken

String SCOPE = Scopes.PLUS_LOGIN; ... String scope = String.format("oauth2:server:client_id:%s:api_scope:%s", CLIENT_ID, SCOPE); String token = GoogleAuthUtil.getToken(AuthorizedActivity.this, email, scope); ... //send received token to server for confirmation ... try { GoogleAuthUtil.clearToken(AuthorizedActivity.this, token); } catch (GoogleAuthException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } ... 

and my server:

 ... $client = new Google_Client(); $client->setClientId('CLIENT_ID'); $client->setClientSecret('CLIENT_SECRET'); $client->setDeveloperKey(''); $client->authenticate('token_from_device'); return json_decode($client->getAccessToken())->access_token; // temporary ... 

, and this still happens an hour after the token is cleared.

So, my question is what I am doing wrong, and why I continue to receive a consent screen after clearing the token used. Do I need a specific permit, incorrect coverage, or am I missing something else?

+7
android google-plus
source share

No one has answered this question yet.

See related questions:

568
What permission do I need to access the Internet from an Android application?
2
How do I create a Google Oauth2 client ID that doesn't just return "Forbidden"?
2
Always get a UserRecoverableAuthException for NEED_PERMISSION even when checking the application from the device?
one
Handling expired access token in Android without user concentration
one
Secret of OAuth2 Client Submission at Authorization Stage
one
administrator did not agree to use the application - Azure AD
one
OAuth2 Native Applications - Client Secret
0
Store an access token in an OAuth2.0 application and reuse it until it expires?
0
can google signin scopes be cleared?

All Articles