title: Unifying OAuth handling between gdata and newer Google APIs
body: <p>I'm working with the <a href="https://developers.google.com/google-apps/contacts/v3/" rel="nofollow">Google Contacts API</a> and <a href="https://developers.google.com/google-apps/calendar/" rel="nofollow">Google Calendar API</a> in Python. The former is a GData API and the latter is a Google API... API, so while clients are available, they're each covered by separate clients -- here's <a href="http://code.google.com/p/gdata-python-client/" rel="nofollow">GData</a>, and <a href="http://code.google.com/p/google-api-python-client/" rel="nofollow">Google API</a>.</p>
  
  <p>The problem I'm running into working with these clients is that they both have their own way of dealing with OAuth2. The GData library provides <code>gdata.gauth.token_to_blob(auth_token)</code> and <code>gdata.gauth.token_from_blob(auth_token)</code> methods to translate auth tokens to/from strings to store in a database, while the google-api library provides <a href="https://developers.google.com/api-client-library/python/guide/google_app_engine#Credentials" rel="nofollow">a method on App Engine</a> (the platform I'm writing for) to store the OAuth credentials.</p>
  
  <p>I don't see a clear way to store a single thing (whether it be an access token or credentials) accessible to both APIs, but I <em>really</em> don't want users to have to authenticate twice. Is there a way to accomplish this, short of ditching Google's client libraries and writing straight HTTP calls?</p>