title: Google OAuth2 - tokens, on-line, offline, adding scopes incrementally
body: <p>Trying to organize this question into something clear. We are integrating Google for Work into our application, to use login, Google+, and eventually Contacts, Calendar, etc. As is recommended by Google and everything I have read, we are going to use incremental access, only adding scopes when they are needed. We are a PHP shop.</p>
  
  <p>But, we will also be needing offline access, as our Contacts (and eventually Calendar) access will be synchronizing with our internal database.</p>
  
  <p>We currently capture the Access and Refresh Tokens when doing the initial link, and store them locally, so that we can re-authorize at any time by using the Refresh token whenever the Access token expires. This is working correctly.</p>
  
  <p>Questions:<br>
  a) when adding the incremental scopes for Contacts, the documentation says we need to call the <code>gapi.auth.signIn()</code> function in the page javascript with the new scopes. This is working on the page where we are allowing folks to manage settings. In the original login function callback, I save the Access Token and scopes with an Ajax call that uses the access code passed into the callback, and calls the <code>Google_Client authenticate()</code> function to get the access code and scopes... but at that point, the information I get back does not have the new scopes. Why? Do I have to re-extend the scopes every time the page is drawn?</p>
  
  <p>b) since we are going to have a batch process do the contact synchronization, do I need to get an entirely different access token with <code>access_type=offline</code>, or can I use the current access token (properly extended with the new scopes). Can an off-line access token be used for on-line access as well as off-line? Or vice-versa?</p>