title: In Google Apps Script, avoid second 'Review Permissions' prompt, possibly by using approval_prompt
body: <p>I have searched StackOverflow, etc. for a solution to this problem, and several answers 'point me in a direction' (mentioning approval_prompt = auto not approval_prompt = force), but none are applicable (as far as I can tell) to my situation.</p>
  
  <p>I have a Web Application hosted at www.mjpanel.com that expects to use a Google Apps Script that I 'own', but the Javascript at www.mjpanel.com calls the Google Apps Script (deployed as a Web App with doGet()) as a Web Service.  It expects the web service call to return various JSON objects.</p>
  
  <p>If the user has not yet authorized my application, the call to the Google Apps Script Web App / Web Service will not return a JSON object, causing www.mjpanel.com Javascript code to fail saying "Invalid Request" (because it isn't a JSON object as my code expects).</p>
  
  <p>To prevent this from happening, www.mjpanel.com uses gapi.auth2.init to get the permissions/scopes it needs.  I'm developing everything now, so if/whenever the Google Apps Script evolve to use something (like sending GMail emails as the user) that is new, I have been figuring out the scope to request, adding it to the list of scopes in the gapi.auth2.init call, and everything is fine.  The next time a user uses the app., they get initially prompted for the newly added scope, then everything proceeds fine.</p>
  
  <p>However, now sometimes one of my test users has a Web Service call fail because Google Apps Script is returning another request for permissions for a 'new permission' of 'Have Offline Access'.</p>
  
  <p>There's nothing about my script that would warrant the user needing to grant this permission.</p>
  
  <p>When I research, a lot of stuff (mostly about requesting OAuth2 stuff in a 'structure' different than the way my app. is set up) says it has to do with submitting a 'approval_prompt=force' in my request URL.</p>
  
  <p>However, the way I have my app set up, all the URLs I would use (aside from my 'custom stuff' in the query string) are dictated by Google Apps Script.  And I can't find any place where any URL I use has an approval_prompt in it.</p>
  
  <p>I can't figure out where I would need to configure that approval_prompt to be auto (as is recommended in the 'successful answers' I find).</p>
  
  <p>Of if the idea of approval_prompt is 'on the wrong track', any information in general to help me solve this problem would be greatly appreciated.</p>
  
  <p>Thanks in advance for any help you can give me.</p>