Repository URL to install this package:
|
Version:
2.1.0.jo1 ▾
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module gdata.gauth</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="gdata.html"><font color="#ffffff">gdata</font></a>.gauth</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/gauth.py">/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/gauth.py</a></font></td></tr></table>
<p><tt>Provides auth related token classes and functions for Google Data APIs.<br>
<br>
Token classes represent a user's authorization of this app to access their<br>
data. Usually these are not created directly but by a GDClient <a href="__builtin__.html#object">object</a>.<br>
<br>
<a href="#ClientLoginToken">ClientLoginToken</a><br>
<a href="#AuthSubToken">AuthSubToken</a><br>
<a href="#SecureAuthSubToken">SecureAuthSubToken</a><br>
<a href="#OAuthHmacToken">OAuthHmacToken</a><br>
<a href="#OAuthRsaToken">OAuthRsaToken</a><br>
<a href="#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a><br>
<a href="#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a><br>
<br>
Functions which are often used in application code (as opposed to just within<br>
the gdata-python-client library) are the following:<br>
<br>
generate_auth_sub_url<br>
authorize_request_token<br>
<br>
The following are helper functions which are used to save and load auth token<br>
objects in the App Engine datastore. These should only be used if you are using<br>
this library within App Engine:<br>
<br>
ae_load<br>
ae_save</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="atom.html">atom</a><br>
<a href="datetime.html">datetime</a><br>
</td><td width="25%" valign=top><a href="random.html">random</a><br>
<a href="simplejson.html">simplejson</a><br>
</td><td width="25%" valign=top><a href="time.html">time</a><br>
<a href="urllib.html">urllib</a><br>
</td><td width="25%" valign=top><a href="urlparse.html">urlparse</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#AuthSubToken">AuthSubToken</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#SecureAuthSubToken">SecureAuthSubToken</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#ClientLoginToken">ClientLoginToken</a>
</font></dt><dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuth2Token">OAuth2Token</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuth2TokenFromCredentials">OAuth2TokenFromCredentials</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuthRsaToken">OAuthRsaToken</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a>
</font></dt></dl>
</dd>
</dl>
</dd>
<dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#Error">Error</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuth2AccessTokenError">OAuth2AccessTokenError</a>
</font></dt><dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuth2RevokeError">OAuth2RevokeError</a>
</font></dt><dt><font face="helvetica, arial"><a href="gdata.gauth.html#UnsupportedTokenType">UnsupportedTokenType</a>
</font></dt></dl>
</dd>
</dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="AuthSubToken">class <strong>AuthSubToken</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="AuthSubToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#AuthSubToken-modify_request">modify_request</a>(self, http_request)</dt></dl>
<dl><dt><a name="AuthSubToken-__init__"><strong>__init__</strong></a>(self, token_string, scopes<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="AuthSubToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets Authorization header, allows app to act on the user's behalf.</tt></dd></dl>
<hr>
Static methods defined here:<br>
<dl><dt><a name="AuthSubToken-FromUrl"><strong>FromUrl</strong></a> = from_url(str_or_uri)</dt><dd><tt>Creates a new <a href="#AuthSubToken">AuthSubToken</a> using information in the URL.<br>
<br>
Uses auth_sub_string_from_url.<br>
<br>
Args:<br>
str_or_uri: The current page's URL (as a str or atom.http_core.Uri)<br>
which should contain a token query parameter since the<br>
Google auth server redirected the user's browser to this<br>
URL.</tt></dd></dl>
<dl><dt><a name="AuthSubToken-from_url"><strong>from_url</strong></a>(str_or_uri)</dt><dd><tt>Creates a new <a href="#AuthSubToken">AuthSubToken</a> using information in the URL.<br>
<br>
Uses auth_sub_string_from_url.<br>
<br>
Args:<br>
str_or_uri: The current page's URL (as a str or atom.http_core.Uri)<br>
which should contain a token query parameter since the<br>
Google auth server redirected the user's browser to this<br>
URL.</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="ClientLoginToken">class <strong>ClientLoginToken</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ClientLoginToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#ClientLoginToken-modify_request">modify_request</a>(self, http_request)</dt></dl>
<dl><dt><a name="ClientLoginToken-__init__"><strong>__init__</strong></a>(self, token_string)</dt></dl>
<dl><dt><a name="ClientLoginToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Error">class <strong>Error</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#Error">Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="Error-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__init__">__init__</a>(...) initializes x; see help(type(x)) for signature</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#Error-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl>
<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="Error-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
<dl><dt><a name="Error-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
<dl><dt><a name="Error-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
<dl><dt><a name="Error-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
<br>
Use of negative indices is not supported.</tt></dd></dl>
<dl><dt><a name="Error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
<dl><dt><a name="Error-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
<dl><dt><a name="Error-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
<dl><dt><a name="Error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
<dl><dt><a name="Error-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__str__">__str__</a>() <==> str(x)</tt></dd></dl>
<dl><dt><a name="Error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="OAuth2AccessTokenError">class <strong>OAuth2AccessTokenError</strong></a>(<a href="gdata.gauth.html#Error">Error</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Raised when an OAuth2 error occurs.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#OAuth2AccessTokenError">OAuth2AccessTokenError</a></dd>
<dd><a href="gdata.gauth.html#Error">Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="OAuth2AccessTokenError-__init__"><strong>__init__</strong></a>(self, error_message)</dt></dl>
<hr>
Data descriptors inherited from <a href="gdata.gauth.html#Error">Error</a>:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#OAuth2AccessTokenError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl>
<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="OAuth2AccessTokenError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
<dl><dt><a name="OAuth2AccessTokenError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
<dl><dt><a name="OAuth2AccessTokenError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
<dl><dt><a name="OAuth2AccessTokenError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
<br>
Use of negative indices is not supported.</tt></dd></dl>
<dl><dt><a name="OAuth2AccessTokenError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
<dl><dt><a name="OAuth2AccessTokenError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
<dl><dt><a name="OAuth2AccessTokenError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
<dl><dt><a name="OAuth2AccessTokenError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
<dl><dt><a name="OAuth2AccessTokenError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__str__">__str__</a>() <==> str(x)</tt></dd></dl>
<dl><dt><a name="OAuth2AccessTokenError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="OAuth2RevokeError">class <strong>OAuth2RevokeError</strong></a>(<a href="gdata.gauth.html#Error">Error</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Raised when an OAuth2 token revocation was unsuccessful.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#OAuth2RevokeError">OAuth2RevokeError</a></dd>
<dd><a href="gdata.gauth.html#Error">Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="OAuth2RevokeError-__init__"><strong>__init__</strong></a>(self, http_response, response_body<font color="#909090">=None</font>)</dt><dd><tt>Sets the HTTP information in the error.<br>
<br>
Args:<br>
http_response: The response from the server, contains error information.<br>
response_body: string (optional) specified if the response has already<br>
been read from the http_response <a href="__builtin__.html#object">object</a>.</tt></dd></dl>
<dl><dt><a name="OAuth2RevokeError-__str__"><strong>__str__</strong></a>(self)</dt></dl>
<hr>
Data descriptors inherited from <a href="gdata.gauth.html#Error">Error</a>:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#OAuth2RevokeError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl>
<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="OAuth2RevokeError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
<dl><dt><a name="OAuth2RevokeError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
<dl><dt><a name="OAuth2RevokeError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
<dl><dt><a name="OAuth2RevokeError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
<br>
Use of negative indices is not supported.</tt></dd></dl>
<dl><dt><a name="OAuth2RevokeError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
<dl><dt><a name="OAuth2RevokeError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
<dl><dt><a name="OAuth2RevokeError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
<dl><dt><a name="OAuth2RevokeError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
<dl><dt><a name="OAuth2RevokeError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="OAuth2Token">class <strong>OAuth2Token</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Token <a href="__builtin__.html#object">object</a> for OAuth 2.0 as described on<br>
<<a href="http://code.google.com/apis/accounts/docs/OAuth2.html">http://code.google.com/apis/accounts/docs/OAuth2.html</a>>.<br>
<br>
Token can be applied to a gdata.client.GDClient <a href="__builtin__.html#object">object</a> using the <a href="#OAuth2Token-authorize">authorize</a>()<br>
method, which then signs each request from that <a href="__builtin__.html#object">object</a> with the OAuth 2.0<br>
access token.<br>
This class supports 3 flows of OAuth 2.0:<br>
Client-side web flow: call generate_authorize_url with `response_type='token''<br>
and the registered `redirect_uri'.<br>
Server-side web flow: call generate_authorize_url with the registered<br>
`redirect_url'.<br>
Native applications flow: call generate_authorize_url as it is. You will have<br>
to ask the user to go to the generated url and pass in the authorization<br>
code to your application.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="OAuth2Token-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#OAuth2Token-modify_request">modify_request</a>(self, http_request)</dt></dl>
<dl><dt><a name="OAuth2Token-__init__"><strong>__init__</strong></a>(self, client_id, client_secret, scope, user_agent, auth_uri<font color="#909090">='https://accounts.google.com/o/oauth2/auth'</font>, token_uri<font color="#909090">='https://accounts.google.com/o/oauth2/token'</font>, access_token<font color="#909090">=None</font>, refresh_token<font color="#909090">=None</font>, revoke_uri<font color="#909090">='https://accounts.google.com/o/oauth2/revoke'</font>)</dt><dd><tt>Create an instance of <a href="#OAuth2Token">OAuth2Token</a><br>
<br>
Args:<br>
client_id: string, client identifier.<br>
client_secret: string client secret.<br>
scope: string, scope of the credentials being requested.<br>
user_agent: string, HTTP User-Agent to provide for this application.<br>
auth_uri: string, URI for authorization endpoint. For convenience<br>
defaults to Google's endpoints but any OAuth 2.0 provider can be used.<br>
token_uri: string, URI for token endpoint. For convenience<br>
defaults to Google's endpoints but any OAuth 2.0 provider can be used.<br>
revoke_uri: string, URI for revoke endpoint. For convenience<br>
defaults to Google's endpoints but any OAuth 2.0 provider can be used.<br>
access_token: string, access token.<br>
refresh_token: string, refresh token.</tt></dd></dl>
<dl><dt><a name="OAuth2Token-authorize"><strong>authorize</strong></a>(self, client)</dt><dd><tt>Authorize a gdata.client.GDClient instance with these credentials.<br>
<br>
Args:<br>
client: An instance of gdata.client.GDClient<br>
or something that acts like it.<br>
<br>
Returns:<br>
A modified instance of client that was passed in.<br>
<br>
Example:<br>
>>> c = gdata.client.GDClient(source='user-agent')<br>
>>> c = token.<a href="#OAuth2Token-authorize">authorize</a>(c)</tt></dd></dl>
<dl><dt><a name="OAuth2Token-generate_authorize_url"><strong>generate_authorize_url</strong></a>(self, redirect_uri<font color="#909090">='urn:ietf:wg:oauth:2.0:oob'</font>, response_type<font color="#909090">='code'</font>, access_type<font color="#909090">='offline'</font>, approval_prompt<font color="#909090">='auto'</font>, **kwargs)</dt><dd><tt>Returns a URI to redirect to the provider.<br>
<br>
Args:<br>
redirect_uri: Either the string 'urn:ietf:wg:oauth:2.0:oob' for a<br>
non-web-based application, or a URI that handles the<br>
callback from the authorization server.<br>
response_type: Either the string 'code' for server-side or native<br>
application, or the string 'token' for client-side<br>
application.<br>
access_type: Either the string 'offline' to request a refresh token or<br>
'online'.<br>
approval_prompt: Either the string 'auto' to let the OAuth mechanism<br>
determine if the approval page is needed or 'force'<br>
if the approval prompt is desired in all cases.<br>
<br>
If redirect_uri is 'urn:ietf:wg:oauth:2.0:oob' then pass in the<br>
generated verification code to get_access_token,<br>
otherwise pass in the query parameters received<br>
at the callback uri to get_access_token.<br>
If the response_type is 'token', no need to call<br>
get_access_token as the API will return it within<br>
the query parameters received at the callback:<br>
oauth2_token.access_token = YOUR_ACCESS_TOKEN</tt></dd></dl>
<dl><dt><a name="OAuth2Token-get_access_token"><strong>get_access_token</strong></a>(self, code)</dt><dd><tt>Exhanges a code for an access token.<br>
<br>
Args:<br>
code: string or dict, either the code as a string, or a dictionary<br>
of the query parameters to the redirect_uri, which contains<br>
the code.</tt></dd></dl>
<dl><dt><a name="OAuth2Token-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets the Authorization header in the HTTP request using the token.<br>
<br>
Returns:<br>
The same HTTP request <a href="__builtin__.html#object">object</a> which was passed in.</tt></dd></dl>
<dl><dt><a name="OAuth2Token-revoke"><strong>revoke</strong></a>(self, revoke_uri<font color="#909090">=None</font>, refresh_token<font color="#909090">=None</font>)</dt><dd><tt>Revokes access via a refresh token.<br>
<br>
Args:<br>
revoke_uri: string, URI for revoke endpoint. If not provided, or if<br>
None is provided, the revoke_uri attribute on the <a href="__builtin__.html#object">object</a> is used.<br>
refresh_token: string, refresh token. If not provided, or if None is<br>
provided, the refresh_token attribute on the <a href="__builtin__.html#object">object</a> is used.<br>
<br>
Raises:<br>
<a href="#UnsupportedTokenType">UnsupportedTokenType</a> if the token is not one of the supported token<br>
classes listed above.<br>
<br>
Example:<br>
>>> token.<a href="#OAuth2Token-revoke">revoke</a>()</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<dl><dt><strong>invalid</strong></dt>
<dd><tt>True if the credentials are invalid, such as being revoked.</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="OAuth2TokenFromCredentials">class <strong>OAuth2TokenFromCredentials</strong></a>(<a href="gdata.gauth.html#OAuth2Token">OAuth2Token</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Special subclass to be used in conjunction with google-api-python-client.<br>
<br>
These libraries are built for different purposes. This one is used for APIs<br>
that use the GData Protocol:<br>
https://developers.google.com/gdata/docs/2.0/reference<br>
while google-api-python-client is for APIs which are discovery-based:<br>
https://developers.google.com/discovery/v1/getting_started#background<br>
<br>
Developers using Google APIs may want to use both simultaneously, and this<br>
class provides a way for them to use OAuth 2.0 credentials obtained for use<br>
with google-api-python-client as credentials in gdata-python-client and to<br>
ensure all token/credential refresh impacts both this <a href="__builtin__.html#object">object</a> and the<br>
google-api-python-client credentials <a href="__builtin__.html#object">object</a>.<br>
<br>
In addition, any manual patching of this <a href="__builtin__.html#object">object</a> or the credentials <a href="__builtin__.html#object">object</a> will<br>
be immediately reflected since attributes such as `client_id`, `access_token`,<br>
etc. are directly proxied between instances of this class and the credentials<br>
objects that they own.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#OAuth2TokenFromCredentials">OAuth2TokenFromCredentials</a></dd>
<dd><a href="gdata.gauth.html#OAuth2Token">OAuth2Token</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="OAuth2TokenFromCredentials-__init__"><strong>__init__</strong></a>(self, credentials)</dt><dd><tt>Constructor for <a href="#OAuth2TokenFromCredentials">OAuth2TokenFromCredentials</a> <a href="__builtin__.html#object">object</a>.<br>
<br>
The constructor for the superclass is not called because the actual values<br>
are retrieved from the credentials <a href="__builtin__.html#object">object</a> directly via `property` instances<br>
which act as proxies.<br>
<br>
Args:<br>
credentials: An instance of oauth2client.client.Credentials or some<br>
subclass.</tt></dd></dl>
<dl><dt><a name="OAuth2TokenFromCredentials-generate_authorize_url"><strong>generate_authorize_url</strong></a>(self, *args, **kwargs)</dt><dd><tt># Disable methods not supported by Credentials.</tt></dd></dl>
<dl><dt><a name="OAuth2TokenFromCredentials-get_access_token"><strong>get_access_token</strong></a>(self, *args, **kwargs)</dt></dl>
<dl><dt><a name="OAuth2TokenFromCredentials-revoke"><strong>revoke</strong></a>(self, *args, **kwargs)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>access_token</strong></dt>
</dl>
<dl><dt><strong>client_id</strong></dt>
</dl>
<dl><dt><strong>client_secret</strong></dt>
</dl>
<dl><dt><strong>refresh_token</strong></dt>
</dl>
<dl><dt><strong>token_expiry</strong></dt>
</dl>
<dl><dt><strong>token_uri</strong></dt>
</dl>
<dl><dt><strong>user_agent</strong></dt>
</dl>
<hr>
Methods inherited from <a href="gdata.gauth.html#OAuth2Token">OAuth2Token</a>:<br>
<dl><dt><a name="OAuth2TokenFromCredentials-ModifyRequest"><strong>ModifyRequest</strong></a> = modify_request(self, http_request)</dt><dd><tt>Sets the Authorization header in the HTTP request using the token.<br>
<br>
Returns:<br>
The same HTTP request <a href="__builtin__.html#object">object</a> which was passed in.</tt></dd></dl>
<dl><dt><a name="OAuth2TokenFromCredentials-authorize"><strong>authorize</strong></a>(self, client)</dt><dd><tt>Authorize a gdata.client.GDClient instance with these credentials.<br>
<br>
Args:<br>
client: An instance of gdata.client.GDClient<br>
or something that acts like it.<br>
<br>
Returns:<br>
A modified instance of client that was passed in.<br>
<br>
Example:<br>
>>> c = gdata.client.GDClient(source='user-agent')<br>
>>> c = token.<a href="#OAuth2TokenFromCredentials-authorize">authorize</a>(c)</tt></dd></dl>
<dl><dt><a name="OAuth2TokenFromCredentials-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets the Authorization header in the HTTP request using the token.<br>
<br>
Returns:<br>
The same HTTP request <a href="__builtin__.html#object">object</a> which was passed in.</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="gdata.gauth.html#OAuth2Token">OAuth2Token</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<dl><dt><strong>invalid</strong></dt>
<dd><tt>True if the credentials are invalid, such as being revoked.</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="OAuthHmacToken">class <strong>OAuthHmacToken</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="OAuthHmacToken-GenerateAuthorizationUrl"><strong>GenerateAuthorizationUrl</strong></a> = <a href="#OAuthHmacToken-generate_authorization_url">generate_authorization_url</a>(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt></dl>
<dl><dt><a name="OAuthHmacToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#OAuthHmacToken-modify_request">modify_request</a>(self, http_request)</dt></dl>
<dl><dt><a name="OAuthHmacToken-__init__"><strong>__init__</strong></a>(self, consumer_key, consumer_secret, token, token_secret, auth_state, next<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="OAuthHmacToken-generate_authorization_url"><strong>generate_authorization_url</strong></a>(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates the URL at which the user can authorize this app to access.<br>
<br>
Args:<br>
google_apps_domain: str (optional) If the user should be signing in<br>
using an account under a known Google Apps domain, provide the<br>
domain name ('example.com') here. If not provided, 'default'<br>
will be used, and the user will be prompted to select an account<br>
if they are signed in with a Google Account and Google Apps<br>
accounts.<br>
language: str (optional) An ISO 639 country code identifying what<br>
language the approval page should be translated in (for example,<br>
'en' for English). The default is the user's selected language.<br>
btmpl: str (optional) Forces a mobile version of the approval page. The<br>
only accepted value is 'mobile'.<br>
auth_server: str (optional) The start of the token authorization web<br>
page. Defaults to<br>
'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>
<dl><dt><a name="OAuthHmacToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets the Authorization header in the HTTP request using the token.<br>
<br>
Calculates an HMAC signature using the information in the token to<br>
indicate that the request came from this application and that this<br>
application has permission to access a particular user's data.<br>
<br>
Returns:<br>
The same HTTP request <a href="__builtin__.html#object">object</a> which was passed in.</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>SIGNATURE_METHOD</strong> = 'HMAC-SHA1'</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="OAuthRsaToken">class <strong>OAuthRsaToken</strong></a>(<a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#OAuthRsaToken">OAuthRsaToken</a></dd>
<dd><a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="OAuthRsaToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#OAuthRsaToken-modify_request">modify_request</a>(self, http_request)</dt></dl>
<dl><dt><a name="OAuthRsaToken-__init__"><strong>__init__</strong></a>(self, consumer_key, rsa_private_key, token, token_secret, auth_state, next<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="OAuthRsaToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets the Authorization header in the HTTP request using the token.<br>
<br>
Calculates an RSA signature using the information in the token to<br>
indicate that the request came from this application and that this<br>
application has permission to access a particular user's data.<br>
<br>
Returns:<br>
The same HTTP request <a href="__builtin__.html#object">object</a> which was passed in.</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>SIGNATURE_METHOD</strong> = 'RSA-SHA1'</dl>
<hr>
Methods inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><a name="OAuthRsaToken-GenerateAuthorizationUrl"><strong>GenerateAuthorizationUrl</strong></a> = generate_authorization_url(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates the URL at which the user can authorize this app to access.<br>
<br>
Args:<br>
google_apps_domain: str (optional) If the user should be signing in<br>
using an account under a known Google Apps domain, provide the<br>
domain name ('example.com') here. If not provided, 'default'<br>
will be used, and the user will be prompted to select an account<br>
if they are signed in with a Google Account and Google Apps<br>
accounts.<br>
language: str (optional) An ISO 639 country code identifying what<br>
language the approval page should be translated in (for example,<br>
'en' for English). The default is the user's selected language.<br>
btmpl: str (optional) Forces a mobile version of the approval page. The<br>
only accepted value is 'mobile'.<br>
auth_server: str (optional) The start of the token authorization web<br>
page. Defaults to<br>
'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>
<dl><dt><a name="OAuthRsaToken-generate_authorization_url"><strong>generate_authorization_url</strong></a>(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates the URL at which the user can authorize this app to access.<br>
<br>
Args:<br>
google_apps_domain: str (optional) If the user should be signing in<br>
using an account under a known Google Apps domain, provide the<br>
domain name ('example.com') here. If not provided, 'default'<br>
will be used, and the user will be prompted to select an account<br>
if they are signed in with a Google Account and Google Apps<br>
accounts.<br>
language: str (optional) An ISO 639 country code identifying what<br>
language the approval page should be translated in (for example,<br>
'en' for English). The default is the user's selected language.<br>
btmpl: str (optional) Forces a mobile version of the approval page. The<br>
only accepted value is 'mobile'.<br>
auth_server: str (optional) The start of the token authorization web<br>
page. Defaults to<br>
'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="SecureAuthSubToken">class <strong>SecureAuthSubToken</strong></a>(<a href="gdata.gauth.html#AuthSubToken">AuthSubToken</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#SecureAuthSubToken">SecureAuthSubToken</a></dd>
<dd><a href="gdata.gauth.html#AuthSubToken">AuthSubToken</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="SecureAuthSubToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#SecureAuthSubToken-modify_request">modify_request</a>(self, http_request)</dt></dl>
<dl><dt><a name="SecureAuthSubToken-__init__"><strong>__init__</strong></a>(self, token_string, rsa_private_key, scopes<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="SecureAuthSubToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets the Authorization header and includes a digital signature.<br>
<br>
Calculates a digital signature using the private RSA key, a timestamp<br>
(uses now at the time this method is called) and a random nonce.<br>
<br>
Args:<br>
http_request: The atom.http_core.HttpRequest which contains all of the<br>
information needed to send a request to the remote server. The<br>
URL and the method of the request must be already set and cannot be<br>
changed after this token signs the request, or the signature will<br>
not be valid.</tt></dd></dl>
<hr>
Static methods defined here:<br>
<dl><dt><a name="SecureAuthSubToken-FromUrl"><strong>FromUrl</strong></a> = from_url(str_or_uri, rsa_private_key)</dt><dd><tt>Creates a new <a href="#SecureAuthSubToken">SecureAuthSubToken</a> using information in the URL.<br>
<br>
Uses auth_sub_string_from_url.<br>
<br>
Args:<br>
str_or_uri: The current page's URL (as a str or atom.http_core.Uri)<br>
which should contain a token query parameter since the Google auth<br>
server redirected the user's browser to this URL.<br>
rsa_private_key: str the private RSA key cert used to sign all requests<br>
made with this token.</tt></dd></dl>
<dl><dt><a name="SecureAuthSubToken-from_url"><strong>from_url</strong></a>(str_or_uri, rsa_private_key)</dt><dd><tt>Creates a new <a href="#SecureAuthSubToken">SecureAuthSubToken</a> using information in the URL.<br>
<br>
Uses auth_sub_string_from_url.<br>
<br>
Args:<br>
str_or_uri: The current page's URL (as a str or atom.http_core.Uri)<br>
which should contain a token query parameter since the Google auth<br>
server redirected the user's browser to this URL.<br>
rsa_private_key: str the private RSA key cert used to sign all requests<br>
made with this token.</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="gdata.gauth.html#AuthSubToken">AuthSubToken</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="TwoLeggedOAuthHmacToken">class <strong>TwoLeggedOAuthHmacToken</strong></a>(<a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a></dd>
<dd><a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="TwoLeggedOAuthHmacToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#TwoLeggedOAuthHmacToken-modify_request">modify_request</a>(self, http_request)</dt></dl>
<dl><dt><a name="TwoLeggedOAuthHmacToken-__init__"><strong>__init__</strong></a>(self, consumer_key, consumer_secret, requestor_id)</dt></dl>
<dl><dt><a name="TwoLeggedOAuthHmacToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets the Authorization header in the HTTP request using the token.<br>
<br>
Calculates an HMAC signature using the information in the token to<br>
indicate that the request came from this application and that this<br>
application has permission to access a particular user's data using 2LO.<br>
<br>
Returns:<br>
The same HTTP request <a href="__builtin__.html#object">object</a> which was passed in.</tt></dd></dl>
<hr>
Methods inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><a name="TwoLeggedOAuthHmacToken-GenerateAuthorizationUrl"><strong>GenerateAuthorizationUrl</strong></a> = generate_authorization_url(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates the URL at which the user can authorize this app to access.<br>
<br>
Args:<br>
google_apps_domain: str (optional) If the user should be signing in<br>
using an account under a known Google Apps domain, provide the<br>
domain name ('example.com') here. If not provided, 'default'<br>
will be used, and the user will be prompted to select an account<br>
if they are signed in with a Google Account and Google Apps<br>
accounts.<br>
language: str (optional) An ISO 639 country code identifying what<br>
language the approval page should be translated in (for example,<br>
'en' for English). The default is the user's selected language.<br>
btmpl: str (optional) Forces a mobile version of the approval page. The<br>
only accepted value is 'mobile'.<br>
auth_server: str (optional) The start of the token authorization web<br>
page. Defaults to<br>
'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>
<dl><dt><a name="TwoLeggedOAuthHmacToken-generate_authorization_url"><strong>generate_authorization_url</strong></a>(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates the URL at which the user can authorize this app to access.<br>
<br>
Args:<br>
google_apps_domain: str (optional) If the user should be signing in<br>
using an account under a known Google Apps domain, provide the<br>
domain name ('example.com') here. If not provided, 'default'<br>
will be used, and the user will be prompted to select an account<br>
if they are signed in with a Google Account and Google Apps<br>
accounts.<br>
language: str (optional) An ISO 639 country code identifying what<br>
language the approval page should be translated in (for example,<br>
'en' for English). The default is the user's selected language.<br>
btmpl: str (optional) Forces a mobile version of the approval page. The<br>
only accepted value is 'mobile'.<br>
auth_server: str (optional) The start of the token authorization web<br>
page. Defaults to<br>
'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><strong>SIGNATURE_METHOD</strong> = 'HMAC-SHA1'</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="TwoLeggedOAuthRsaToken">class <strong>TwoLeggedOAuthRsaToken</strong></a>(<a href="gdata.gauth.html#OAuthRsaToken">OAuthRsaToken</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a></dd>
<dd><a href="gdata.gauth.html#OAuthRsaToken">OAuthRsaToken</a></dd>
<dd><a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="TwoLeggedOAuthRsaToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#TwoLeggedOAuthRsaToken-modify_request">modify_request</a>(self, http_request)</dt></dl>
<dl><dt><a name="TwoLeggedOAuthRsaToken-__init__"><strong>__init__</strong></a>(self, consumer_key, rsa_private_key, requestor_id)</dt></dl>
<dl><dt><a name="TwoLeggedOAuthRsaToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets the Authorization header in the HTTP request using the token.<br>
<br>
Calculates an RSA signature using the information in the token to<br>
indicate that the request came from this application and that this<br>
application has permission to access a particular user's data using 2LO.<br>
<br>
Returns:<br>
The same HTTP request <a href="__builtin__.html#object">object</a> which was passed in.</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="gdata.gauth.html#OAuthRsaToken">OAuthRsaToken</a>:<br>
<dl><dt><strong>SIGNATURE_METHOD</strong> = 'RSA-SHA1'</dl>
<hr>
Methods inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><a name="TwoLeggedOAuthRsaToken-GenerateAuthorizationUrl"><strong>GenerateAuthorizationUrl</strong></a> = generate_authorization_url(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates the URL at which the user can authorize this app to access.<br>
<br>
Args:<br>
google_apps_domain: str (optional) If the user should be signing in<br>
using an account under a known Google Apps domain, provide the<br>
domain name ('example.com') here. If not provided, 'default'<br>
will be used, and the user will be prompted to select an account<br>
if they are signed in with a Google Account and Google Apps<br>
accounts.<br>
language: str (optional) An ISO 639 country code identifying what<br>
language the approval page should be translated in (for example,<br>
'en' for English). The default is the user's selected language.<br>
btmpl: str (optional) Forces a mobile version of the approval page. The<br>
only accepted value is 'mobile'.<br>
auth_server: str (optional) The start of the token authorization web<br>
page. Defaults to<br>
'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>
<dl><dt><a name="TwoLeggedOAuthRsaToken-generate_authorization_url"><strong>generate_authorization_url</strong></a>(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates the URL at which the user can authorize this app to access.<br>
<br>
Args:<br>
google_apps_domain: str (optional) If the user should be signing in<br>
using an account under a known Google Apps domain, provide the<br>
domain name ('example.com') here. If not provided, 'default'<br>
will be used, and the user will be prompted to select an account<br>
if they are signed in with a Google Account and Google Apps<br>
accounts.<br>
language: str (optional) An ISO 639 country code identifying what<br>
language the approval page should be translated in (for example,<br>
'en' for English). The default is the user's selected language.<br>
btmpl: str (optional) Forces a mobile version of the approval page. The<br>
only accepted value is 'mobile'.<br>
auth_server: str (optional) The start of the token authorization web<br>
page. Defaults to<br>
'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="UnsupportedTokenType">class <strong>UnsupportedTokenType</strong></a>(<a href="gdata.gauth.html#Error">Error</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Raised when token to or from blob is unable to convert the token.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#UnsupportedTokenType">UnsupportedTokenType</a></dd>
<dd><a href="gdata.gauth.html#Error">Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Data descriptors inherited from <a href="gdata.gauth.html#Error">Error</a>:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="UnsupportedTokenType-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__init__">__init__</a>(...) initializes x; see help(type(x)) for signature</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#UnsupportedTokenType-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl>
<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="UnsupportedTokenType-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
<dl><dt><a name="UnsupportedTokenType-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
<dl><dt><a name="UnsupportedTokenType-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
<dl><dt><a name="UnsupportedTokenType-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
<br>
Use of negative indices is not supported.</tt></dd></dl>
<dl><dt><a name="UnsupportedTokenType-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
<dl><dt><a name="UnsupportedTokenType-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
<dl><dt><a name="UnsupportedTokenType-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
<dl><dt><a name="UnsupportedTokenType-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
<dl><dt><a name="UnsupportedTokenType-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__str__">__str__</a>() <==> str(x)</tt></dd></dl>
<dl><dt><a name="UnsupportedTokenType-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-AeDelete"><strong>AeDelete</strong></a> = ae_delete(token_key)</dt><dd><tt>Removes the token <a href="__builtin__.html#object">object</a> from the App Engine datastore.</tt></dd></dl>
<dl><dt><a name="-AeLoad"><strong>AeLoad</strong></a> = ae_load(token_key)</dt><dd><tt>Retrieves a token <a href="__builtin__.html#object">object</a> from the App Engine datastore.<br>
<br>
This is a convenience method for using the library with App Engine.<br>
See also ae_save.<br>
<br>
Args:<br>
token_key: str The unique key associated with the desired token when it<br>
was saved using ae_save.<br>
<br>
Returns:<br>
A token <a href="__builtin__.html#object">object</a> if there was a token associated with the token_key or None<br>
if the key could not be found.</tt></dd></dl>
<dl><dt><a name="-AeSave"><strong>AeSave</strong></a> = ae_save(token, token_key)</dt><dd><tt>Stores an auth token in the App Engine datastore.<br>
<br>
This is a convenience method for using the library with App Engine.<br>
Recommended usage is to associate the auth token with the current_user.<br>
If a user is signed in to the app using the App Engine users API, you<br>
can use<br>
gdata.gauth.<a href="#-ae_save">ae_save</a>(some_token, users.get_current_user().user_id())<br>
If you are not using the Users API you are free to choose whatever<br>
string you would like for a token_string.<br>
<br>
Args:<br>
token: an auth token <a href="__builtin__.html#object">object</a>. Must be one of <a href="#ClientLoginToken">ClientLoginToken</a>,<br>
<a href="#AuthSubToken">AuthSubToken</a>, <a href="#SecureAuthSubToken">SecureAuthSubToken</a>, <a href="#OAuthRsaToken">OAuthRsaToken</a>, or <a href="#OAuthHmacToken">OAuthHmacToken</a><br>
(see token_to_blob).<br>
token_key: str A unique identified to be used when you want to retrieve<br>
the token. If the user is signed in to App Engine using the<br>
users API, I recommend using the user ID for the token_key:<br>
users.get_current_user().user_id()</tt></dd></dl>
<dl><dt><a name="-AuthSubStringFromUrl"><strong>AuthSubStringFromUrl</strong></a> = auth_sub_string_from_url(url, scopes_param_prefix<font color="#909090">='auth_sub_scopes'</font>)</dt><dd><tt>Finds the token string (and scopes) after the browser is redirected.<br>
<br>
After the Google Accounts AuthSub pages redirect the user's broswer back to<br>
the web application (using the 'next' URL from the request) the web app must<br>
extract the token from the current page's URL. The token is provided as a<br>
URL parameter named 'token' and if generate_auth_sub_url was used to create<br>
the request, the token's valid scopes are included in a URL parameter whose<br>
name is specified in scopes_param_prefix.<br>
<br>
Args:<br>
url: atom.url.Url or str representing the current URL. The token value<br>
and valid scopes should be included as URL parameters.<br>
scopes_param_prefix: str (optional) The URL parameter key which maps to<br>
the list of valid scopes for the token.<br>
<br>
Returns:<br>
A tuple containing the token value as a string, and a tuple of scopes<br>
(as atom.http_core.Uri objects) which are URL prefixes under which this<br>
token grants permission to read and write user data.<br>
(token_string, (scope_uri, scope_uri, scope_uri, ...))<br>
If no scopes were included in the URL, the second value in the tuple is<br>
None. If there was no token param in the url, the tuple returned is<br>
(None, None)</tt></dd></dl>
<dl><dt><a name="-AuthorizeRequestToken"><strong>AuthorizeRequestToken</strong></a> = authorize_request_token(request_token, url)</dt><dd><tt>Adds information to request token to allow it to become an access token.<br>
<br>
Modifies the request_token <a href="__builtin__.html#object">object</a> passed in by setting and unsetting the<br>
necessary fields to allow this token to form a valid upgrade request.<br>
<br>
Args:<br>
request_token: The OAuth request token which has been authorized by the<br>
user. In order for this token to be upgraded to an access token,<br>
certain fields must be extracted from the URL and added to the token<br>
so that they can be passed in an upgrade-token request.<br>
url: The URL of the current page which the user's browser was redirected<br>
to after they authorized access for the app. This function extracts<br>
information from the URL which is needed to upgraded the token from<br>
a request token to an access token.<br>
<br>
Returns:<br>
The same token <a href="__builtin__.html#object">object</a> which was passed in.</tt></dd></dl>
<dl><dt><a name="-FindScopesForServices"><strong>FindScopesForServices</strong></a> = find_scopes_for_services(service_names<font color="#909090">=None</font>)</dt><dd><tt>Creates a combined list of scope URLs for the desired services.<br>
<br>
This method searches the AUTH_SCOPES dictionary.<br>
<br>
Args:<br>
service_names: list of strings (optional) Each name must be a key in the<br>
AUTH_SCOPES dictionary. If no list is provided (None) then<br>
the resulting list will contain all scope URLs in the<br>
AUTH_SCOPES dict.<br>
<br>
Returns:<br>
A list of URL strings which are the scopes needed to access these services<br>
when requesting a token using AuthSub or OAuth.</tt></dd></dl>
<dl><dt><a name="-GenerateClientLoginRequestBody"><strong>GenerateClientLoginRequestBody</strong></a> = generate_client_login_request_body(email, password, service, source, account_type<font color="#909090">='HOSTED_OR_GOOGLE'</font>, captcha_token<font color="#909090">=None</font>, captcha_response<font color="#909090">=None</font>)</dt><dd><tt>Creates the body of the autentication request<br>
<br>
See <a href="http://code.google.com/apis/accounts/AuthForInstalledApps.html#Request">http://code.google.com/apis/accounts/AuthForInstalledApps.html#Request</a><br>
for more details.<br>
<br>
Args:<br>
email: str<br>
password: str<br>
service: str<br>
source: str<br>
account_type: str (optional) Defaul is 'HOSTED_OR_GOOGLE', other valid<br>
values are 'GOOGLE' and 'HOSTED'<br>
captcha_token: str (optional)<br>
captcha_response: str (optional)<br>
<br>
Returns:<br>
The HTTP body to send in a request for a client login token.</tt></dd></dl>
<dl><dt><a name="-GetCaptchaChallenge"><strong>GetCaptchaChallenge</strong></a> = get_captcha_challenge(http_body, captcha_base_url<font color="#909090">='http://www.google.com/accounts/'</font>)</dt><dd><tt>Returns the URL and token for a CAPTCHA challenge issued by the server.<br>
<br>
Args:<br>
http_body: str The body of the HTTP response from the server which<br>
contains the CAPTCHA challenge.<br>
captcha_base_url: str This function returns a full URL for viewing the<br>
challenge image which is built from the server's response. This<br>
base_url is used as the beginning of the URL because the server<br>
only provides the end of the URL. For example the server provides<br>
'Captcha?ctoken=Hi...N' and the URL for the image is<br>
'<a href="http://www.google.com/accounts/Captcha?ctoken=Hi...N">http://www.google.com/accounts/Captcha?ctoken=Hi...N</a>'<br>
<br>
Returns:<br>
A dictionary containing the information needed to repond to the CAPTCHA<br>
challenge, the image URL and the ID token of the challenge. The<br>
dictionary is in the form:<br>
{'token': string identifying the CAPTCHA image,<br>
'url': string containing the URL of the image}<br>
Returns None if there was no CAPTCHA challenge in the response.</tt></dd></dl>
<dl><dt><a name="-GetClientLoginTokenString"><strong>GetClientLoginTokenString</strong></a> = get_client_login_token_string(http_body)</dt><dd><tt>Returns the token value for a <a href="#ClientLoginToken">ClientLoginToken</a>.<br>
<br>
Reads the token from the server's response to a Client Login request and<br>
creates the token value string to use in requests.<br>
<br>
Args:<br>
http_body: str The body of the server's HTTP response to a Client Login<br>
request<br>
<br>
Returns:<br>
The token value string for a <a href="#ClientLoginToken">ClientLoginToken</a>.</tt></dd></dl>
<dl><dt><a name="-TokenFromBlob"><strong>TokenFromBlob</strong></a> = token_from_blob(blob)</dt><dd><tt>Deserializes a token string from the datastore back into a token <a href="__builtin__.html#object">object</a>.<br>
<br>
Supported token classes: <a href="#ClientLoginToken">ClientLoginToken</a>, <a href="#AuthSubToken">AuthSubToken</a>, <a href="#SecureAuthSubToken">SecureAuthSubToken</a>,<br>
<a href="#OAuthRsaToken">OAuthRsaToken</a>, and <a href="#OAuthHmacToken">OAuthHmacToken</a>, <a href="#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a>,<br>
<a href="#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a> and <a href="#OAuth2Token">OAuth2Token</a>.<br>
<br>
Args:<br>
blob: string created by token_to_blob.<br>
<br>
Raises:<br>
<a href="#UnsupportedTokenType">UnsupportedTokenType</a> if the token is not one of the supported token<br>
classes listed above.<br>
<br>
Returns:<br>
A new token <a href="__builtin__.html#object">object</a> with members set to the values serialized in the<br>
blob string. Note that any members which were set to '' in the original<br>
token will now be None.</tt></dd></dl>
<dl><dt><a name="-TokenToBlob"><strong>TokenToBlob</strong></a> = token_to_blob(token)</dt><dd><tt>Serializes the token data as a string for storage in a datastore.<br>
<br>
Supported token classes: <a href="#ClientLoginToken">ClientLoginToken</a>, <a href="#AuthSubToken">AuthSubToken</a>, <a href="#SecureAuthSubToken">SecureAuthSubToken</a>,<br>
<a href="#OAuthRsaToken">OAuthRsaToken</a>, and <a href="#OAuthHmacToken">OAuthHmacToken</a>, <a href="#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a>,<br>
<a href="#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a> and <a href="#OAuth2Token">OAuth2Token</a>.<br>
<br>
Args:<br>
token: A token <a href="__builtin__.html#object">object</a> which must be of one of the supported token classes.<br>
<br>
Raises:<br>
<a href="#UnsupportedTokenType">UnsupportedTokenType</a> if the token is not one of the supported token<br>
classes listed above.<br>
<br>
Returns:<br>
A string represenging this token. The string can be converted back into<br>
an equivalent token <a href="__builtin__.html#object">object</a> using token_from_blob. Note that any members<br>
which are set to '' will be set to None when the token is deserialized<br>
by token_from_blob.</tt></dd></dl>
<dl><dt><a name="-UpgradeToAccessToken"><strong>UpgradeToAccessToken</strong></a> = upgrade_to_access_token(request_token, server_response_body)</dt><dd><tt>Extracts access token information from response to an upgrade request.<br>
<br>
Once the server has responded with the new token info for the OAuth<br>
access token, this method modifies the request_token to set and unset<br>
necessary fields to create valid OAuth authorization headers for requests.<br>
<br>
Args:<br>
request_token: An OAuth token which this function modifies to allow it<br>
to be used as an access token.<br>
server_response_body: str The server's response to an OAuthAuthorizeToken<br>
request. This should contain the new token and token_secret which<br>
are used to generate the signature and parameters of the Authorization<br>
header in subsequent requests to Google Data APIs.<br>
<br>
Returns:<br>
The same token <a href="__builtin__.html#object">object</a> which was passed in.</tt></dd></dl>
<dl><dt><a name="-ae_delete"><strong>ae_delete</strong></a>(token_key)</dt><dd><tt>Removes the token <a href="__builtin__.html#object">object</a> from the App Engine datastore.</tt></dd></dl>
<dl><dt><a name="-ae_load"><strong>ae_load</strong></a>(token_key)</dt><dd><tt>Retrieves a token <a href="__builtin__.html#object">object</a> from the App Engine datastore.<br>
<br>
This is a convenience method for using the library with App Engine.<br>
See also ae_save.<br>
<br>
Args:<br>
token_key: str The unique key associated with the desired token when it<br>
was saved using ae_save.<br>
<br>
Returns:<br>
A token <a href="__builtin__.html#object">object</a> if there was a token associated with the token_key or None<br>
if the key could not be found.</tt></dd></dl>
<dl><dt><a name="-ae_save"><strong>ae_save</strong></a>(token, token_key)</dt><dd><tt>Stores an auth token in the App Engine datastore.<br>
<br>
This is a convenience method for using the library with App Engine.<br>
Recommended usage is to associate the auth token with the current_user.<br>
If a user is signed in to the app using the App Engine users API, you<br>
can use<br>
gdata.gauth.<a href="#-ae_save">ae_save</a>(some_token, users.get_current_user().user_id())<br>
If you are not using the Users API you are free to choose whatever<br>
string you would like for a token_string.<br>
<br>
Args:<br>
token: an auth token <a href="__builtin__.html#object">object</a>. Must be one of <a href="#ClientLoginToken">ClientLoginToken</a>,<br>
<a href="#AuthSubToken">AuthSubToken</a>, <a href="#SecureAuthSubToken">SecureAuthSubToken</a>, <a href="#OAuthRsaToken">OAuthRsaToken</a>, or <a href="#OAuthHmacToken">OAuthHmacToken</a><br>
(see token_to_blob).<br>
token_key: str A unique identified to be used when you want to retrieve<br>
the token. If the user is signed in to App Engine using the<br>
users API, I recommend using the user ID for the token_key:<br>
users.get_current_user().user_id()</tt></dd></dl>
<dl><dt><a name="-auth_sub_string_from_body"><strong>auth_sub_string_from_body</strong></a>(http_body)</dt><dd><tt>Extracts the AuthSub token from an HTTP body string.<br>
<br>
Used to find the new session token after making a request to upgrade a<br>
single use AuthSub token.<br>
<br>
Args:<br>
http_body: str The repsonse from the server which contains the AuthSub<br>
key. For example, this function would find the new session token<br>
from the server's response to an upgrade token request.<br>
<br>
Returns:<br>
The raw token value string to use in an <a href="#AuthSubToken">AuthSubToken</a> <a href="__builtin__.html#object">object</a>.</tt></dd></dl>
<dl><dt><a name="-auth_sub_string_from_url"><strong>auth_sub_string_from_url</strong></a>(url, scopes_param_prefix<font color="#909090">='auth_sub_scopes'</font>)</dt><dd><tt>Finds the token string (and scopes) after the browser is redirected.<br>
<br>
After the Google Accounts AuthSub pages redirect the user's broswer back to<br>
the web application (using the 'next' URL from the request) the web app must<br>
extract the token from the current page's URL. The token is provided as a<br>
URL parameter named 'token' and if generate_auth_sub_url was used to create<br>
the request, the token's valid scopes are included in a URL parameter whose<br>
name is specified in scopes_param_prefix.<br>
<br>
Args:<br>
url: atom.url.Url or str representing the current URL. The token value<br>
and valid scopes should be included as URL parameters.<br>
scopes_param_prefix: str (optional) The URL parameter key which maps to<br>
the list of valid scopes for the token.<br>
<br>
Returns:<br>
A tuple containing the token value as a string, and a tuple of scopes<br>
(as atom.http_core.Uri objects) which are URL prefixes under which this<br>
token grants permission to read and write user data.<br>
(token_string, (scope_uri, scope_uri, scope_uri, ...))<br>
If no scopes were included in the URL, the second value in the tuple is<br>
None. If there was no token param in the url, the tuple returned is<br>
(None, None)</tt></dd></dl>
<dl><dt><a name="-authorize_request_token"><strong>authorize_request_token</strong></a>(request_token, url)</dt><dd><tt>Adds information to request token to allow it to become an access token.<br>
<br>
Modifies the request_token <a href="__builtin__.html#object">object</a> passed in by setting and unsetting the<br>
necessary fields to allow this token to form a valid upgrade request.<br>
<br>
Args:<br>
request_token: The OAuth request token which has been authorized by the<br>
user. In order for this token to be upgraded to an access token,<br>
certain fields must be extracted from the URL and added to the token<br>
so that they can be passed in an upgrade-token request.<br>
url: The URL of the current page which the user's browser was redirected<br>
to after they authorized access for the app. This function extracts<br>
information from the URL which is needed to upgraded the token from<br>
a request token to an access token.<br>
<br>
Returns:<br>
The same token <a href="__builtin__.html#object">object</a> which was passed in.</tt></dd></dl>
<dl><dt><a name="-build_auth_sub_data"><strong>build_auth_sub_data</strong></a>(http_request, timestamp, nonce)</dt><dd><tt>Creates the data string which must be RSA-signed in secure requests.<br>
<br>
For more details see the documenation on secure AuthSub requests:<br>
<a href="http://code.google.com/apis/accounts/docs/AuthSub.html#signingrequests">http://code.google.com/apis/accounts/docs/AuthSub.html#signingrequests</a><br>
<br>
Args:<br>
http_request: The request being made to the server. The Request's URL<br>
must be complete before this signature is calculated as any changes<br>
to the URL will invalidate the signature.<br>
nonce: str Random 64-bit, unsigned number encoded as an ASCII string in<br>
decimal format. The nonce/timestamp pair should always be unique to<br>
prevent replay attacks.<br>
timestamp: Integer representing the time the request is sent. The<br>
timestamp should be expressed in number of seconds after January 1,<br>
1970 00:00:00 GMT.</tt></dd></dl>
<dl><dt><a name="-build_oauth_base_string"><strong>build_oauth_base_string</strong></a>(http_request, consumer_key, nonce, signaure_type, timestamp, version, next<font color="#909090">='oob'</font>, token<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt><dd><tt>Generates the base string to be signed in the OAuth request.<br>
<br>
Args:<br>
http_request: The request being made to the server. The Request's URL<br>
must be complete before this signature is calculated as any changes<br>
to the URL will invalidate the signature.<br>
consumer_key: Domain identifying the third-party web application. This is<br>
the domain used when registering the application with Google. It<br>
identifies who is making the request on behalf of the user.<br>
nonce: Random 64-bit, unsigned number encoded as an ASCII string in decimal<br>
format. The nonce/timestamp pair should always be unique to prevent<br>
replay attacks.<br>
signaure_type: either RSA_SHA1 or HMAC_SHA1<br>
timestamp: Integer representing the time the request is sent. The<br>
timestamp should be expressed in number of seconds after January 1,<br>
1970 00:00:00 GMT.<br>
version: The OAuth version used by the requesting web application. This<br>
value must be '1.0' or '1.0a'. If not provided, Google assumes version<br>
1.0 is in use.<br>
next: The URL the user should be redirected to after granting access<br>
to a Google service(s). It can include url-encoded query parameters.<br>
The default value is 'oob'. (This is the oauth_callback.)<br>
token: The string for the OAuth request token or OAuth access token.<br>
verifier: str Sent as the oauth_verifier and required when upgrading a<br>
request token to an access token.</tt></dd></dl>
<dl><dt><a name="-dump_tokens"><strong>dump_tokens</strong></a>(tokens)</dt></dl>
<dl><dt><a name="-find_scopes_for_services"><strong>find_scopes_for_services</strong></a>(service_names<font color="#909090">=None</font>)</dt><dd><tt>Creates a combined list of scope URLs for the desired services.<br>
<br>
This method searches the AUTH_SCOPES dictionary.<br>
<br>
Args:<br>
service_names: list of strings (optional) Each name must be a key in the<br>
AUTH_SCOPES dictionary. If no list is provided (None) then<br>
the resulting list will contain all scope URLs in the<br>
AUTH_SCOPES dict.<br>
<br>
Returns:<br>
A list of URL strings which are the scopes needed to access these services<br>
when requesting a token using AuthSub or OAuth.</tt></dd></dl>
<dl><dt><a name="-generate_auth_header"><strong>generate_auth_header</strong></a>(consumer_key, timestamp, nonce, signature_type, signature, version<font color="#909090">='1.0'</font>, next<font color="#909090">=None</font>, token<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt><dd><tt>Builds the Authorization header to be sent in the request.<br>
<br>
Args:<br>
consumer_key: Identifies the application making the request (str).<br>
timestamp:<br>
nonce:<br>
signature_type: One of either HMAC_SHA1 or RSA_SHA1<br>
signature: The HMAC or RSA signature for the request as a base64<br>
encoded string.<br>
version: The version of the OAuth protocol that this request is using.<br>
Default is '1.0'<br>
next: The URL of the page that the user's browser should be sent to<br>
after they authorize the token. (Optional)<br>
token: str The OAuth token value to be used in the oauth_token parameter<br>
of the header.<br>
verifier: str The OAuth verifier which must be included when you are<br>
upgrading a request token to an access token.</tt></dd></dl>
<dl><dt><a name="-generate_auth_sub_url"><strong>generate_auth_sub_url</strong></a>(next, scopes, secure<font color="#909090">=False</font>, session<font color="#909090">=True</font>, request_url<font color="#909090">=<atom.http_core.Uri object></font>, domain<font color="#909090">='default'</font>, scopes_param_prefix<font color="#909090">='auth_sub_scopes'</font>)</dt><dd><tt>Constructs a URI for requesting a multiscope AuthSub token.<br>
<br>
The generated token will contain a URL parameter to pass along the<br>
requested scopes to the next URL. When the Google Accounts page<br>
redirects the broswser to the 'next' URL, it appends the single use<br>
AuthSub token value to the URL as a URL parameter with the key 'token'.<br>
However, the information about which scopes were requested is not<br>
included by Google Accounts. This method adds the scopes to the next<br>
URL before making the request so that the redirect will be sent to<br>
a page, and both the token value and the list of scopes for which the token<br>
was requested.<br>
<br>
Args:<br>
next: atom.http_core.Uri or string The URL user will be sent to after<br>
authorizing this web application to access their data.<br>
scopes: list containint strings or atom.http_core.Uri objects. The URLs<br>
of the services to be accessed. Could also be a single string<br>
or single atom.http_core.Uri for requesting just one scope.<br>
secure: boolean (optional) Determines whether or not the issued token<br>
is a secure token.<br>
session: boolean (optional) Determines whether or not the issued token<br>
can be upgraded to a session token.<br>
request_url: atom.http_core.Uri or str The beginning of the request URL.<br>
This is normally<br>
'<a href="http://www.google.com/accounts/AuthSubRequest">http://www.google.com/accounts/AuthSubRequest</a>' or<br>
'/accounts/AuthSubRequest'<br>
domain: The domain which the account is part of. This is used for Google<br>
Apps accounts, the default value is 'default' which means that<br>
the requested account is a Google Account (@gmail.com for<br>
example)<br>
scopes_param_prefix: str (optional) The requested scopes are added as a<br>
URL parameter to the next URL so that the page at<br>
the 'next' URL can extract the token value and the<br>
valid scopes from the URL. The key for the URL<br>
parameter defaults to 'auth_sub_scopes'<br>
<br>
Returns:<br>
An atom.http_core.Uri which the user's browser should be directed to in<br>
order to authorize this application to access their information.</tt></dd></dl>
<dl><dt><a name="-generate_client_login_request_body"><strong>generate_client_login_request_body</strong></a>(email, password, service, source, account_type<font color="#909090">='HOSTED_OR_GOOGLE'</font>, captcha_token<font color="#909090">=None</font>, captcha_response<font color="#909090">=None</font>)</dt><dd><tt>Creates the body of the autentication request<br>
<br>
See <a href="http://code.google.com/apis/accounts/AuthForInstalledApps.html#Request">http://code.google.com/apis/accounts/AuthForInstalledApps.html#Request</a><br>
for more details.<br>
<br>
Args:<br>
email: str<br>
password: str<br>
service: str<br>
source: str<br>
account_type: str (optional) Defaul is 'HOSTED_OR_GOOGLE', other valid<br>
values are 'GOOGLE' and 'HOSTED'<br>
captcha_token: str (optional)<br>
captcha_response: str (optional)<br>
<br>
Returns:<br>
The HTTP body to send in a request for a client login token.</tt></dd></dl>
<dl><dt><a name="-generate_hmac_signature"><strong>generate_hmac_signature</strong></a>(http_request, consumer_key, consumer_secret, timestamp, nonce, version, next<font color="#909090">='oob'</font>, token<font color="#909090">=None</font>, token_secret<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="-generate_oauth_authorization_url"><strong>generate_oauth_authorization_url</strong></a>(token, next<font color="#909090">=None</font>, hd<font color="#909090">='default'</font>, hl<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates a URL for the page where the request token can be authorized.<br>
<br>
Args:<br>
token: str The request token from the OAuth server.<br>
next: str (optional) URL the user should be redirected to after granting<br>
access to a Google service(s). It can include url-encoded query<br>
parameters.<br>
hd: str (optional) Identifies a particular hosted domain account to be<br>
accessed (for example, 'mycollege.edu'). Uses 'default' to specify a<br>
regular Google account ('username@gmail.com').<br>
hl: str (optional) An ISO 639 country code identifying what language the<br>
approval page should be translated in (for example, 'hl=en' for<br>
English). The default is the user's selected language.<br>
btmpl: str (optional) Forces a mobile version of the approval page. The<br>
only accepted value is 'mobile'.<br>
auth_server: str (optional) The start of the token authorization web<br>
page. Defaults to<br>
'https://www.google.com/accounts/OAuthAuthorizeToken'<br>
<br>
Returns:<br>
An atom.http_core.Uri pointing to the token authorization page where the<br>
user may allow or deny this app to access their Google data.</tt></dd></dl>
<dl><dt><a name="-generate_request_for_access_token"><strong>generate_request_for_access_token</strong></a>(request_token, auth_server_url<font color="#909090">='https://www.google.com/accounts/OAuthGetAccessToken'</font>)</dt><dd><tt>Creates a request to ask the OAuth server for an access token.<br>
<br>
Requires a request token which the user has authorized. See the<br>
documentation on OAuth with Google Data for more details:<br>
<a href="http://code.google.com/apis/accounts/docs/OAuth.html#AccessToken">http://code.google.com/apis/accounts/docs/OAuth.html#AccessToken</a><br>
<br>
Args:<br>
request_token: An <a href="#OAuthHmacToken">OAuthHmacToken</a> or <a href="#OAuthRsaToken">OAuthRsaToken</a> which the user has<br>
approved using their browser.<br>
auth_server_url: (optional) The URL at which the OAuth access token is<br>
requested. Defaults to<br>
https://www.google.com/accounts/OAuthGetAccessToken<br>
<br>
Returns:<br>
A new HttpRequest <a href="__builtin__.html#object">object</a> which can be sent to the OAuth server to<br>
request an OAuth Access Token.</tt></dd></dl>
<dl><dt><a name="-generate_request_for_request_token"><strong>generate_request_for_request_token</strong></a>(consumer_key, signature_type, scopes, rsa_key<font color="#909090">=None</font>, consumer_secret<font color="#909090">=None</font>, auth_server_url<font color="#909090">='https://www.google.com/accounts/OAuthGetRequestToken'</font>, next<font color="#909090">='oob'</font>, version<font color="#909090">='1.0'</font>)</dt><dd><tt>Creates request to be sent to auth server to get an OAuth request token.<br>
<br>
Args:<br>
consumer_key:<br>
signature_type: either RSA_SHA1 or HMAC_SHA1. The rsa_key must be<br>
provided if the signature type is RSA but if the signature method<br>
is HMAC, the consumer_secret must be used.<br>
scopes: List of URL prefixes for the data which we want to access. For<br>
example, to request access to the user's Blogger and Google Calendar<br>
data, we would request<br>
['<a href="http://www.blogger.com/feeds/">http://www.blogger.com/feeds/</a>',<br>
'https://www.google.com/calendar/feeds/',<br>
'<a href="http://www.google.com/calendar/feeds/">http://www.google.com/calendar/feeds/</a>']<br>
rsa_key: Only used if the signature method is RSA_SHA1.<br>
consumer_secret: Only used if the signature method is HMAC_SHA1.<br>
auth_server_url: The URL to which the token request should be directed.<br>
Defaults to 'https://www.google.com/accounts/OAuthGetRequestToken'.<br>
next: The URL of the page that the user's browser should be sent to<br>
after they authorize the token. (Optional)<br>
version: The OAuth version used by the requesting web application.<br>
Defaults to '1.0a'<br>
<br>
Returns:<br>
An atom.http_core.HttpRequest <a href="__builtin__.html#object">object</a> with the URL, Authorization header<br>
and body filled in.</tt></dd></dl>
<dl><dt><a name="-generate_rsa_signature"><strong>generate_rsa_signature</strong></a>(http_request, consumer_key, rsa_key, timestamp, nonce, version, next<font color="#909090">='oob'</font>, token<font color="#909090">=None</font>, token_secret<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="-generate_signature"><strong>generate_signature</strong></a>(data, rsa_key)</dt><dd><tt>Signs the data string for a secure AuthSub request.</tt></dd></dl>
<dl><dt><a name="-get_captcha_challenge"><strong>get_captcha_challenge</strong></a>(http_body, captcha_base_url<font color="#909090">='http://www.google.com/accounts/'</font>)</dt><dd><tt>Returns the URL and token for a CAPTCHA challenge issued by the server.<br>
<br>
Args:<br>
http_body: str The body of the HTTP response from the server which<br>
contains the CAPTCHA challenge.<br>
captcha_base_url: str This function returns a full URL for viewing the<br>
challenge image which is built from the server's response. This<br>
base_url is used as the beginning of the URL because the server<br>
only provides the end of the URL. For example the server provides<br>
'Captcha?ctoken=Hi...N' and the URL for the image is<br>
'<a href="http://www.google.com/accounts/Captcha?ctoken=Hi...N">http://www.google.com/accounts/Captcha?ctoken=Hi...N</a>'<br>
<br>
Returns:<br>
A dictionary containing the information needed to repond to the CAPTCHA<br>
challenge, the image URL and the ID token of the challenge. The<br>
dictionary is in the form:<br>
{'token': string identifying the CAPTCHA image,<br>
'url': string containing the URL of the image}<br>
Returns None if there was no CAPTCHA challenge in the response.</tt></dd></dl>
<dl><dt><a name="-get_client_login_token_string"><strong>get_client_login_token_string</strong></a>(http_body)</dt><dd><tt>Returns the token value for a <a href="#ClientLoginToken">ClientLoginToken</a>.<br>
<br>
Reads the token from the server's response to a Client Login request and<br>
creates the token value string to use in requests.<br>
<br>
Args:<br>
http_body: str The body of the server's HTTP response to a Client Login<br>
request<br>
<br>
Returns:<br>
The token value string for a <a href="#ClientLoginToken">ClientLoginToken</a>.</tt></dd></dl>
<dl><dt><a name="-hmac_token_from_body"><strong>hmac_token_from_body</strong></a>(http_body, consumer_key, consumer_secret, auth_state)</dt></dl>
<dl><dt><a name="-load_tokens"><strong>load_tokens</strong></a>(blob)</dt></dl>
<dl><dt><a name="-oauth_token_info_from_body"><strong>oauth_token_info_from_body</strong></a>(http_body)</dt><dd><tt>Exracts an OAuth request token from the server's response.<br>
<br>
Returns:<br>
A tuple of strings containing the OAuth token and token secret. If<br>
neither of these are present in the body, returns (None, None)</tt></dd></dl>
<dl><dt><a name="-oauth_token_info_from_url"><strong>oauth_token_info_from_url</strong></a>(url)</dt><dd><tt>Exracts an OAuth access token from the redirected page's URL.<br>
<br>
Returns:<br>
A tuple of strings containing the OAuth token and the OAuth verifier which<br>
need to sent when upgrading a request token to an access token.</tt></dd></dl>
<dl><dt><a name="-rsa_token_from_body"><strong>rsa_token_from_body</strong></a>(http_body, consumer_key, rsa_private_key, auth_state)</dt></dl>
<dl><dt><a name="-token_from_blob"><strong>token_from_blob</strong></a>(blob)</dt><dd><tt>Deserializes a token string from the datastore back into a token <a href="__builtin__.html#object">object</a>.<br>
<br>
Supported token classes: <a href="#ClientLoginToken">ClientLoginToken</a>, <a href="#AuthSubToken">AuthSubToken</a>, <a href="#SecureAuthSubToken">SecureAuthSubToken</a>,<br>
<a href="#OAuthRsaToken">OAuthRsaToken</a>, and <a href="#OAuthHmacToken">OAuthHmacToken</a>, <a href="#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a>,<br>
<a href="#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a> and <a href="#OAuth2Token">OAuth2Token</a>.<br>
<br>
Args:<br>
blob: string created by token_to_blob.<br>
<br>
Raises:<br>
<a href="#UnsupportedTokenType">UnsupportedTokenType</a> if the token is not one of the supported token<br>
classes listed above.<br>
<br>
Returns:<br>
A new token <a href="__builtin__.html#object">object</a> with members set to the values serialized in the<br>
blob string. Note that any members which were set to '' in the original<br>
token will now be None.</tt></dd></dl>
<dl><dt><a name="-token_to_blob"><strong>token_to_blob</strong></a>(token)</dt><dd><tt>Serializes the token data as a string for storage in a datastore.<br>
<br>
Supported token classes: <a href="#ClientLoginToken">ClientLoginToken</a>, <a href="#AuthSubToken">AuthSubToken</a>, <a href="#SecureAuthSubToken">SecureAuthSubToken</a>,<br>
<a href="#OAuthRsaToken">OAuthRsaToken</a>, and <a href="#OAuthHmacToken">OAuthHmacToken</a>, <a href="#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a>,<br>
<a href="#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a> and <a href="#OAuth2Token">OAuth2Token</a>.<br>
<br>
Args:<br>
token: A token <a href="__builtin__.html#object">object</a> which must be of one of the supported token classes.<br>
<br>
Raises:<br>
<a href="#UnsupportedTokenType">UnsupportedTokenType</a> if the token is not one of the supported token<br>
classes listed above.<br>
<br>
Returns:<br>
A string represenging this token. The string can be converted back into<br>
an equivalent token <a href="__builtin__.html#object">object</a> using token_from_blob. Note that any members<br>
which are set to '' will be set to None when the token is deserialized<br>
by token_from_blob.</tt></dd></dl>
<dl><dt><a name="-upgrade_to_access_token"><strong>upgrade_to_access_token</strong></a>(request_token, server_response_body)</dt><dd><tt>Extracts access token information from response to an upgrade request.<br>
<br>
Once the server has responded with the new token info for the OAuth<br>
access token, this method modifies the request_token to set and unset<br>
necessary fields to create valid OAuth authorization headers for requests.<br>
<br>
Args:<br>
request_token: An OAuth token which this function modifies to allow it<br>
to be used as an access token.<br>
server_response_body: str The server's response to an OAuthAuthorizeToken<br>
request. This should contain the new token and token_secret which<br>
are used to generate the signature and parameters of the Authorization<br>
header in subsequent requests to Google Data APIs.<br>
<br>
Returns:<br>
The same token <a href="__builtin__.html#object">object</a> which was passed in.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>ACCESS_TOKEN</strong> = 3<br>
<strong>ACCESS_TOKEN_URL</strong> = 'https://www.google.com/accounts/OAuthGetAccessToken'<br>
<strong>AUTHORIZED_REQUEST_TOKEN</strong> = 2<br>
<strong>AUTHSUB_AUTH_LABEL</strong> = 'AuthSub token='<br>
<strong>AUTH_SCOPES</strong> = {'analytics': ('https://www.google.com/analytics/feeds/',), 'apps': ('https://apps-apis.google.com/a/feeds/user/', 'https://apps-apis.google.com/a/feeds/policies/', 'https://apps-apis.google.com/a/feeds/alias/', 'https://apps-apis.google.com/a/feeds/groups/', 'https://apps-apis.google.com/a/feeds/compliance/audit/', 'https://apps-apis.google.com/a/feeds/migration/', 'https://apps-apis.google.com/a/feeds/emailsettings/2.0/'), 'blogger': ('http://www.blogger.com/feeds/',), 'books': ('http://www.google.com/books/feeds/',), 'cl': ('https://www.google.com/calendar/feeds/', 'http://www.google.com/calendar/feeds/'), 'code': ('http://code.google.com/feeds/issues',), 'codesearch': ('http://www.google.com/codesearch/feeds/',), 'cp': ('https://www.google.com/m8/feeds/', 'http://www.google.com/m8/feeds/'), 'finance': ('http://finance.google.com/finance/feeds/',), 'gbase': ('http://base.google.com/base/feeds/', 'http://www.google.com/base/feeds/'), ...}<br>
<strong>DEFAULT_DOMAIN</strong> = 'default'<br>
<strong>HMAC_SHA1</strong> = 'HMAC-SHA1'<br>
<strong>OAUTH2_AUTH_LABEL</strong> = 'Bearer '<br>
<strong>OAUTH_AUTHORIZE_URL</strong> = 'https://www.google.com/accounts/OAuthAuthorizeToken'<br>
<strong>PROGRAMMATIC_AUTH_LABEL</strong> = 'GoogleLogin auth='<br>
<strong>REQUEST_TOKEN</strong> = 1<br>
<strong>REQUEST_TOKEN_URL</strong> = 'https://www.google.com/accounts/OAuthGetRequestToken'<br>
<strong>RSA_SHA1</strong> = 'RSA-SHA1'<br>
<strong>__author__</strong> = 'j.s@google.com (Jeff Scudder)'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
<td width="100%">j.s@google.com (Jeff Scudder)</td></tr></table>
</body></html>