title: How to use Google Oauth2 access_token?
body: <p>I'm building a SSO setup for a web app.  I can login known users and create new unknown users via <a href="https://www.googleapis.com/oauth2/v1/userinfo" rel="nofollow">https://www.googleapis.com/oauth2/v1/userinfo</a>.</p>
  
  <p>I get back a response like this:</p>
  
  <pre><code>{
      "access_token":"1/fFAGcxxxxxxxxxxxxxxxxxxx",
      "expires_in":3920,
      "token_type":"Bearer",
      "refresh_token":"1/xEoDL4iW3cxlI7yDbSRFYxxxxxxxxxxxxxxxxxxx"
  }
  </code></pre>
  
  <p>So I get the user:</p>
  
  <pre><code>url = 'https://www.googleapis.com/oauth2/v1/userinfo?access_token=%s' % a['access_token']
  req = urllib2.Request( url )
  opener = urllib2.build_opener( urllib2.HTTPSHandler( debuglevel=0 ) )
  req = opener.open( req )
  reply = req.read()
  req.close()
  a = json.loads( reply )
  </code></pre>
  
  <p>That gives me the user's info and permission to access their GMail via
  my initial scope.  But does this method of acquiring the user allow access to the user's
  GMail via imap?</p>
  
  <p><a href="http://code.google.com/apis/gmail/oauth/protocol.html" rel="nofollow">http://code.google.com/apis/gmail/oauth/protocol.html</a></p>
  
  <p>Does the access_token I'm getting allow access to that?  I don't see where to use the '<code>access_token</code>' now that I have it.</p>