title: When is access_type = Online appropriate? :OAuth2 - Google API
body: <p>When requesting OAuth credentials, I can specify the access_type to be Offline or Online.  </p>
  
  <p>Opting for the Online access type forces the users to approve access to my app each time they login.   Why is that?   Hasn't the user already approved my app? </p>
  
  <p><strong>Update #1:</strong></p>
  
  <p>I have my approval_prompt set to 'auto'.<br>
  If I just log out of Google without deleting any cookies, it doesn't prompt me again.  But deleting the cookies brings back the grant screen.  </p>
  
  <p><strong>Update #2:</strong></p>
  
  <p>It works fine through the OAuth Playground.  <a href="http://code.google.com/oauthplayground/">http://code.google.com/oauthplayground/</a></p>
  
  <p>Using OAuth 2.0 for Web Server Applications
  <a href="https://developers.google.com/accounts/docs/OAuth2WebServer">https://developers.google.com/accounts/docs/OAuth2WebServer</a></p>
  
  <p><strong>Update #3:</strong>
  Relevant code snippets</p>
  
  <p>Helper method to generate OAuth URL</p>
  
  <pre><code>def build_auth_uri
      return @client.authorization.authorization_uri(
       :access_type =&gt; :online,
       :approval_prompt =&gt; :auto
      ).to_s 
  end
  </code></pre>
  
  <p>Calling the Helper method in the View</p>
  
  <pre><code>&lt;a href="&lt;%= build_auth_uri %&gt;"&gt;  Connect Me! &lt;/a&gt;
  </code></pre>
  
  <p>Generated OAuth URL on the webpage</p>
  
  <pre><code>https://accounts.google.com/o/oauth2/auth?access_type=online&amp;approval_prompt=auto&amp;redirect_uri=http://localhost:3000/gclient/gcallback&amp;response_type=code
  </code></pre>