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

jayarjo picture jayarjo · Jan 13, 2014 · Viewed 20.7k times · Source

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

Answer

Deepak Mittal picture Deepak Mittal · Jul 23, 2014

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') ;