Reputation: 16716
After having authorized the app with oAuth2 and acquiring permissions for requested scopes, I still get a screen asking if I grant the app permission to Have offline access, each time I try to login with Google oAuth2. Isn't it something that shouldn't appear again, once I grant it permission to have it?
Upvotes: 34
Views: 21746
Reputation: 4210
Most probably this is very normal according to the incremental auth mechanism and its design, The idea is if a user has already granted the permissions to an app, there is no need to show the same permissions and ask the user to approve.
http://googleplusplatform.blogspot.com/2013/12/google-sign-in-improvements11.html
Upvotes: -1
Reputation: 151
This is not an error. This is the normal scenario of google oauth2.
First Process consent as follows:
From Second Process:
Browser checks cookie consent permisson of google account.
Upvotes: 6
Reputation: 199
This prompt could come because of two parameters,
make sure you have set access_type to 'online' and apporoval_prompt to 'auto'
$client->setAccessType('online');
$client->setApprovalPrompt('auto') ;
Upvotes: 13
Reputation:
Do you use the approval_prompt
parameter? Try not to ask for offline access again if you already have an refresh token. It should stay valid even if the user logs in again, without requesting offline access.
A reference about this can be found here.
Upvotes: 10
Reputation: 22286
My guess is that your app has approval_prompt=force to force the OAuth each time. Since the user has already authorised whatever scopes you requested, there is no need to repeat them. However the screen has to say something, so in the absence of any better ideas, Google requests 'offline access".
Just make sure that you are not forcing auth and you should be fine.
Upvotes: 7