Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
607 views
in Technique[技术] by (71.8m points)

oauth 2.0 - The App keeps asking for permission to "Have offline access", why?

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?

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This prompt could come because of two parameters,

  • access_type (if it is 'offline')
  • approval_prompt (if it is 'force')

make sure you have set access_type to 'online' and apporoval_prompt to 'auto'

 $client->setAccessType('online');
 $client->setApprovalPrompt('auto') ;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...