Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 | <html><head><title>Python: module oauth2client.client</title> |
| 4 | </head><body bgcolor="#f0f0f8"> |
| 5 | |
| 6 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
| 7 | <tr bgcolor="#7799ee"> |
| 8 | <td valign=bottom> <br> |
| 9 | <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="oauth2client.html"><font color="#ffffff">oauth2client</font></a>.client</strong></big></big></font></td |
| 10 | ><td align=right valign=bottom |
Joe Gregorio | 351b149 | 2011-05-08 23:32:46 -0700 | [diff] [blame^] | 11 | ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jcgregorio/projects/google-api-python-client/oauth2client/client.py">/home/jcgregorio/projects/google-api-python-client/oauth2client/client.py</a></font></td></tr></table> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 12 | <p><tt>An OAuth 2.0 client<br> |
| 13 | <br> |
| 14 | Tools for interacting with OAuth 2.0 protected<br> |
| 15 | resources.</tt></p> |
| 16 | <p> |
| 17 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 18 | <tr bgcolor="#aa55cc"> |
| 19 | <td colspan=3 valign=bottom> <br> |
| 20 | <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> |
| 21 | |
| 22 | <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
| 23 | <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="copy.html">copy</a><br> |
| 24 | <a href="datetime.html">datetime</a><br> |
| 25 | </td><td width="25%" valign=top><a href="httplib2.html">httplib2</a><br> |
| 26 | <a href="logging.html">logging</a><br> |
| 27 | </td><td width="25%" valign=top><a href="simplejson.html">simplejson</a><br> |
| 28 | <a href="urllib.html">urllib</a><br> |
| 29 | </td><td width="25%" valign=top><a href="urlparse.html">urlparse</a><br> |
| 30 | </td></tr></table></td></tr></table><p> |
| 31 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 32 | <tr bgcolor="#ee77aa"> |
| 33 | <td colspan=3 valign=bottom> <br> |
| 34 | <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| 35 | |
| 36 | <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| 37 | <td width="100%"><dl> |
| 38 | <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> |
| 39 | </font></dt><dd> |
| 40 | <dl> |
| 41 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Credentials">Credentials</a> |
| 42 | </font></dt><dd> |
| 43 | <dl> |
| 44 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 45 | </font></dt><dd> |
| 46 | <dl> |
| 47 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#AccessTokenCredentials">AccessTokenCredentials</a> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 48 | </font></dt></dl> |
| 49 | </dd> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 50 | </dl> |
| 51 | </dd> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 52 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Flow">Flow</a> |
| 53 | </font></dt><dd> |
| 54 | <dl> |
| 55 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#OAuth2WebServerFlow">OAuth2WebServerFlow</a> |
| 56 | </font></dt></dl> |
| 57 | </dd> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 58 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Storage">Storage</a> |
| 59 | </font></dt></dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 60 | </dd> |
| 61 | <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>) |
| 62 | </font></dt><dd> |
| 63 | <dl> |
| 64 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Error">Error</a> |
| 65 | </font></dt><dd> |
| 66 | <dl> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 67 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#AccessTokenCredentialsError">AccessTokenCredentialsError</a> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 68 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.client.html#AccessTokenRefreshError">AccessTokenRefreshError</a> |
| 69 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.client.html#FlowExchangeError">FlowExchangeError</a> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 70 | </font></dt></dl> |
| 71 | </dd> |
| 72 | </dl> |
| 73 | </dd> |
| 74 | </dl> |
| 75 | <p> |
| 76 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 77 | <tr bgcolor="#ffc8d8"> |
| 78 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 79 | <font color="#000000" face="helvetica, arial"><a name="AccessTokenCredentials">class <strong>AccessTokenCredentials</strong></a>(<a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>)</font></td></tr> |
| 80 | |
| 81 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 82 | <td colspan=2><tt><a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> for OAuth 2.0<br> |
| 83 | <br> |
| 84 | <a href="#Credentials">Credentials</a> can be applied to an httplib2.Http <a href="__builtin__.html#object">object</a> using the <a href="#AccessTokenCredentials-authorize">authorize</a>()<br> |
| 85 | method, which then signs each request from that <a href="__builtin__.html#object">object</a> with the OAuth 2.0<br> |
| 86 | access token. This set of credentials is for the use case where you have<br> |
| 87 | acquired an OAuth 2.0 access_token from another place such as a JavaScript<br> |
| 88 | client or another web application, and wish to use it from Python. Because<br> |
| 89 | only the access_token is present it can not be refreshed and will in time<br> |
| 90 | expire.<br> |
| 91 | <br> |
Joe Gregorio | fffa7d7 | 2011-02-18 17:20:39 -0500 | [diff] [blame] | 92 | <a href="#AccessTokenCredentials">AccessTokenCredentials</a> objects may be safely pickled and unpickled.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 93 | <br> |
| 94 | Usage:<br> |
| 95 | credentials = <a href="#AccessTokenCredentials">AccessTokenCredentials</a>('<an access token>',<br> |
| 96 | 'my-user-agent/1.0')<br> |
| 97 | http = httplib2.Http()<br> |
| 98 | http = credentials.<a href="#AccessTokenCredentials-authorize">authorize</a>(http)<br> |
| 99 | <br> |
| 100 | Exceptions:<br> |
| 101 | AccessTokenCredentialsExpired: raised when the access_token expires or is<br> |
| 102 | revoked.<br> </tt></td></tr> |
| 103 | <tr><td> </td> |
| 104 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 105 | <dd><a href="oauth2client.client.html#AccessTokenCredentials">AccessTokenCredentials</a></dd> |
| 106 | <dd><a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a></dd> |
| 107 | <dd><a href="oauth2client.client.html#Credentials">Credentials</a></dd> |
| 108 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 109 | </dl> |
| 110 | <hr> |
| 111 | Methods defined here:<br> |
| 112 | <dl><dt><a name="AccessTokenCredentials-__init__"><strong>__init__</strong></a>(self, access_token, user_agent)</dt><dd><tt>Create an instance of <a href="#OAuth2Credentials">OAuth2Credentials</a><br> |
| 113 | <br> |
| 114 | This is one of the few types if <a href="#Credentials">Credentials</a> that you should contrust,<br> |
| 115 | <a href="#Credentials">Credentials</a> objects are usually instantiated by a <a href="#Flow">Flow</a>.<br> |
| 116 | <br> |
| 117 | Args:<br> |
Joe Gregorio | 9384170 | 2011-03-02 16:12:05 -0800 | [diff] [blame] | 118 | access_token: string, access token.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 119 | user_agent: string, The HTTP User-Agent to provide for this application.<br> |
| 120 | <br> |
| 121 | Notes:<br> |
| 122 | store: callable, a callable that when passed a Credential<br> |
| 123 | will store the credential back to where it came from.</tt></dd></dl> |
| 124 | |
| 125 | <hr> |
| 126 | Methods inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
| 127 | <dl><dt><a name="AccessTokenCredentials-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Trim the state down to something that can be pickled.</tt></dd></dl> |
| 128 | |
| 129 | <dl><dt><a name="AccessTokenCredentials-__setstate__"><strong>__setstate__</strong></a>(self, state)</dt><dd><tt>Reconstitute the state of the <a href="__builtin__.html#object">object</a> from being pickled.</tt></dd></dl> |
| 130 | |
| 131 | <dl><dt><a name="AccessTokenCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these credentials.<br> |
| 132 | <br> |
| 133 | Args:<br> |
| 134 | http: An instance of httplib2.Http<br> |
| 135 | or something that acts like it.<br> |
| 136 | <br> |
| 137 | Returns:<br> |
| 138 | A modified instance of http that was passed in.<br> |
| 139 | <br> |
| 140 | Example:<br> |
| 141 | <br> |
| 142 | h = httplib2.Http()<br> |
| 143 | h = credentials.<a href="#AccessTokenCredentials-authorize">authorize</a>(h)<br> |
| 144 | <br> |
| 145 | You can't create a new OAuth<br> |
| 146 | subclass of httplib2.Authenication because<br> |
| 147 | it never gets passed the absolute URI, which is<br> |
| 148 | needed for signing. So instead we have to overload<br> |
| 149 | 'request' with a closure that adds in the<br> |
| 150 | Authorization header and then calls the original version<br> |
| 151 | of 'request()'.</tt></dd></dl> |
| 152 | |
| 153 | <dl><dt><a name="AccessTokenCredentials-set_store"><strong>set_store</strong></a>(self, store)</dt><dd><tt>Set the storage for the credential.<br> |
| 154 | <br> |
| 155 | Args:<br> |
| 156 | store: callable, a callable that when passed a Credential<br> |
| 157 | will store the credential back to where it came from.<br> |
| 158 | This is needed to store the latest access_token if it<br> |
| 159 | has expired and been refreshed.</tt></dd></dl> |
| 160 | |
| 161 | <hr> |
Joe Gregorio | 9ce4b62 | 2011-02-17 15:32:11 -0500 | [diff] [blame] | 162 | Data descriptors inherited from <a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a>:<br> |
| 163 | <dl><dt><strong>invalid</strong></dt> |
| 164 | <dd><tt>True if the credentials are invalid, such as being revoked.</tt></dd> |
| 165 | </dl> |
| 166 | <hr> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 167 | Data descriptors inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 168 | <dl><dt><strong>__dict__</strong></dt> |
| 169 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 170 | </dl> |
| 171 | <dl><dt><strong>__weakref__</strong></dt> |
| 172 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 173 | </dl> |
| 174 | </td></tr></table> <p> |
| 175 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 176 | <tr bgcolor="#ffc8d8"> |
| 177 | <td colspan=3 valign=bottom> <br> |
| 178 | <font color="#000000" face="helvetica, arial"><a name="AccessTokenCredentialsError">class <strong>AccessTokenCredentialsError</strong></a>(<a href="oauth2client.client.html#Error">Error</a>)</font></td></tr> |
| 179 | |
| 180 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 181 | <td colspan=2><tt>Having only the access_token means no refresh is possible.<br> </tt></td></tr> |
| 182 | <tr><td> </td> |
| 183 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 184 | <dd><a href="oauth2client.client.html#AccessTokenCredentialsError">AccessTokenCredentialsError</a></dd> |
| 185 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 186 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 187 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 188 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 189 | </dl> |
| 190 | <hr> |
| 191 | Data descriptors inherited from <a href="oauth2client.client.html#Error">Error</a>:<br> |
| 192 | <dl><dt><strong>__weakref__</strong></dt> |
| 193 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 194 | </dl> |
| 195 | <hr> |
| 196 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 4258d6b | 2011-03-18 10:20:16 -0400 | [diff] [blame] | 197 | <dl><dt><a name="AccessTokenCredentialsError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__init__">__init__</a>(...) initializes x; see help(type(x)) for signature</tt></dd></dl> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 198 | |
| 199 | <hr> |
| 200 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 201 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#AccessTokenCredentialsError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 202 | |
| 203 | <hr> |
| 204 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 205 | <dl><dt><a name="AccessTokenCredentialsError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 206 | |
| 207 | <dl><dt><a name="AccessTokenCredentialsError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 208 | |
| 209 | <dl><dt><a name="AccessTokenCredentialsError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 210 | |
| 211 | <dl><dt><a name="AccessTokenCredentialsError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 212 | <br> |
| 213 | Use of negative indices is not supported.</tt></dd></dl> |
| 214 | |
| 215 | <dl><dt><a name="AccessTokenCredentialsError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 216 | |
| 217 | <dl><dt><a name="AccessTokenCredentialsError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 218 | |
| 219 | <dl><dt><a name="AccessTokenCredentialsError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 220 | |
| 221 | <dl><dt><a name="AccessTokenCredentialsError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 222 | |
| 223 | <dl><dt><a name="AccessTokenCredentialsError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenCredentialsError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 224 | |
| 225 | <dl><dt><a name="AccessTokenCredentialsError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 226 | |
| 227 | <hr> |
| 228 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 229 | <dl><dt><strong>__dict__</strong></dt> |
| 230 | </dl> |
| 231 | <dl><dt><strong>args</strong></dt> |
| 232 | </dl> |
| 233 | <dl><dt><strong>message</strong></dt> |
| 234 | </dl> |
| 235 | </td></tr></table> <p> |
| 236 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 237 | <tr bgcolor="#ffc8d8"> |
| 238 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 239 | <font color="#000000" face="helvetica, arial"><a name="AccessTokenRefreshError">class <strong>AccessTokenRefreshError</strong></a>(<a href="oauth2client.client.html#Error">Error</a>)</font></td></tr> |
| 240 | |
| 241 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 242 | <td colspan=2><tt><a href="#Error">Error</a> trying to refresh an expired access token.<br> </tt></td></tr> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 243 | <tr><td> </td> |
| 244 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 245 | <dd><a href="oauth2client.client.html#AccessTokenRefreshError">AccessTokenRefreshError</a></dd> |
| 246 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 247 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 248 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 249 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 250 | </dl> |
| 251 | <hr> |
| 252 | Data descriptors inherited from <a href="oauth2client.client.html#Error">Error</a>:<br> |
| 253 | <dl><dt><strong>__weakref__</strong></dt> |
| 254 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 255 | </dl> |
| 256 | <hr> |
| 257 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 4258d6b | 2011-03-18 10:20:16 -0400 | [diff] [blame] | 258 | <dl><dt><a name="AccessTokenRefreshError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__init__">__init__</a>(...) initializes x; see help(type(x)) for signature</tt></dd></dl> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 259 | |
| 260 | <hr> |
| 261 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 262 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#AccessTokenRefreshError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 263 | |
| 264 | <hr> |
| 265 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 266 | <dl><dt><a name="AccessTokenRefreshError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 267 | |
| 268 | <dl><dt><a name="AccessTokenRefreshError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 269 | |
| 270 | <dl><dt><a name="AccessTokenRefreshError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 271 | |
| 272 | <dl><dt><a name="AccessTokenRefreshError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 273 | <br> |
| 274 | Use of negative indices is not supported.</tt></dd></dl> |
| 275 | |
| 276 | <dl><dt><a name="AccessTokenRefreshError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 277 | |
| 278 | <dl><dt><a name="AccessTokenRefreshError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 279 | |
| 280 | <dl><dt><a name="AccessTokenRefreshError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 281 | |
| 282 | <dl><dt><a name="AccessTokenRefreshError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 283 | |
| 284 | <dl><dt><a name="AccessTokenRefreshError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#AccessTokenRefreshError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 285 | |
| 286 | <dl><dt><a name="AccessTokenRefreshError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 287 | |
| 288 | <hr> |
| 289 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 290 | <dl><dt><strong>__dict__</strong></dt> |
| 291 | </dl> |
| 292 | <dl><dt><strong>args</strong></dt> |
| 293 | </dl> |
| 294 | <dl><dt><strong>message</strong></dt> |
| 295 | </dl> |
| 296 | </td></tr></table> <p> |
| 297 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 298 | <tr bgcolor="#ffc8d8"> |
| 299 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 300 | <font color="#000000" face="helvetica, arial"><a name="Credentials">class <strong>Credentials</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 301 | |
| 302 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 303 | <td colspan=2><tt>Base class for all <a href="#Credentials">Credentials</a> objects.<br> |
| 304 | <br> |
| 305 | Subclasses must define an <a href="#Credentials-authorize">authorize</a>() method<br> |
| 306 | that applies the credentials to an HTTP transport.<br> </tt></td></tr> |
| 307 | <tr><td> </td> |
| 308 | <td width="100%">Methods defined here:<br> |
| 309 | <dl><dt><a name="Credentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Take an httplib2.Http instance (or equivalent) and<br> |
| 310 | authorizes it for the set of credentials, usually by<br> |
| 311 | replacing http.request() with a method that adds in<br> |
| 312 | the appropriate headers and then delegates to the original<br> |
| 313 | Http.request() method.</tt></dd></dl> |
| 314 | |
| 315 | <hr> |
| 316 | Data descriptors defined here:<br> |
| 317 | <dl><dt><strong>__dict__</strong></dt> |
| 318 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 319 | </dl> |
| 320 | <dl><dt><strong>__weakref__</strong></dt> |
| 321 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 322 | </dl> |
| 323 | </td></tr></table> <p> |
| 324 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 325 | <tr bgcolor="#ffc8d8"> |
| 326 | <td colspan=3 valign=bottom> <br> |
| 327 | <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> |
| 328 | |
| 329 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 330 | <td colspan=2><tt>Base error for this module.<br> </tt></td></tr> |
| 331 | <tr><td> </td> |
| 332 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 333 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 334 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 335 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 336 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 337 | </dl> |
| 338 | <hr> |
| 339 | Data descriptors defined here:<br> |
| 340 | <dl><dt><strong>__weakref__</strong></dt> |
| 341 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 342 | </dl> |
| 343 | <hr> |
| 344 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 4258d6b | 2011-03-18 10:20:16 -0400 | [diff] [blame] | 345 | <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> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 346 | |
| 347 | <hr> |
| 348 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 349 | <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> |
| 350 | |
| 351 | <hr> |
| 352 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 353 | <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> |
| 354 | |
| 355 | <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> |
| 356 | |
| 357 | <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> |
| 358 | |
| 359 | <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> |
| 360 | <br> |
| 361 | Use of negative indices is not supported.</tt></dd></dl> |
| 362 | |
| 363 | <dl><dt><a name="Error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 364 | |
| 365 | <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> |
| 366 | |
| 367 | <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> |
| 368 | |
| 369 | <dl><dt><a name="Error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 370 | |
| 371 | <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> |
| 372 | |
| 373 | <dl><dt><a name="Error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 374 | |
| 375 | <hr> |
| 376 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 377 | <dl><dt><strong>__dict__</strong></dt> |
| 378 | </dl> |
| 379 | <dl><dt><strong>args</strong></dt> |
| 380 | </dl> |
| 381 | <dl><dt><strong>message</strong></dt> |
| 382 | </dl> |
| 383 | </td></tr></table> <p> |
| 384 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 385 | <tr bgcolor="#ffc8d8"> |
| 386 | <td colspan=3 valign=bottom> <br> |
| 387 | <font color="#000000" face="helvetica, arial"><a name="Flow">class <strong>Flow</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 388 | |
| 389 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 390 | <td colspan=2><tt>Base class for all <a href="#Flow">Flow</a> objects.<br> </tt></td></tr> |
| 391 | <tr><td> </td> |
| 392 | <td width="100%">Data descriptors defined here:<br> |
| 393 | <dl><dt><strong>__dict__</strong></dt> |
| 394 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 395 | </dl> |
| 396 | <dl><dt><strong>__weakref__</strong></dt> |
| 397 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 398 | </dl> |
| 399 | </td></tr></table> <p> |
| 400 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 401 | <tr bgcolor="#ffc8d8"> |
| 402 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 403 | <font color="#000000" face="helvetica, arial"><a name="FlowExchangeError">class <strong>FlowExchangeError</strong></a>(<a href="oauth2client.client.html#Error">Error</a>)</font></td></tr> |
| 404 | |
| 405 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | ad258e2 | 2011-02-22 22:53:30 -0500 | [diff] [blame] | 406 | <td colspan=2><tt><a href="#Error">Error</a> trying to exchange an authorization grant for an access token.<br> </tt></td></tr> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 407 | <tr><td> </td> |
| 408 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 409 | <dd><a href="oauth2client.client.html#FlowExchangeError">FlowExchangeError</a></dd> |
| 410 | <dd><a href="oauth2client.client.html#Error">Error</a></dd> |
| 411 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 412 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 413 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 414 | </dl> |
| 415 | <hr> |
| 416 | Data descriptors inherited from <a href="oauth2client.client.html#Error">Error</a>:<br> |
| 417 | <dl><dt><strong>__weakref__</strong></dt> |
| 418 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 419 | </dl> |
| 420 | <hr> |
| 421 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | 4258d6b | 2011-03-18 10:20:16 -0400 | [diff] [blame] | 422 | <dl><dt><a name="FlowExchangeError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__init__">__init__</a>(...) initializes x; see help(type(x)) for signature</tt></dd></dl> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 423 | |
| 424 | <hr> |
| 425 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 426 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#FlowExchangeError-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl> |
| 427 | |
| 428 | <hr> |
| 429 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 430 | <dl><dt><a name="FlowExchangeError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 431 | |
| 432 | <dl><dt><a name="FlowExchangeError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 433 | |
| 434 | <dl><dt><a name="FlowExchangeError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 435 | |
| 436 | <dl><dt><a name="FlowExchangeError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 437 | <br> |
| 438 | Use of negative indices is not supported.</tt></dd></dl> |
| 439 | |
| 440 | <dl><dt><a name="FlowExchangeError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 441 | |
| 442 | <dl><dt><a name="FlowExchangeError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 443 | |
| 444 | <dl><dt><a name="FlowExchangeError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 445 | |
| 446 | <dl><dt><a name="FlowExchangeError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 447 | |
| 448 | <dl><dt><a name="FlowExchangeError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#FlowExchangeError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 449 | |
| 450 | <dl><dt><a name="FlowExchangeError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 451 | |
| 452 | <hr> |
| 453 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 454 | <dl><dt><strong>__dict__</strong></dt> |
| 455 | </dl> |
| 456 | <dl><dt><strong>args</strong></dt> |
| 457 | </dl> |
| 458 | <dl><dt><strong>message</strong></dt> |
| 459 | </dl> |
| 460 | </td></tr></table> <p> |
| 461 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 462 | <tr bgcolor="#ffc8d8"> |
| 463 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 464 | <font color="#000000" face="helvetica, arial"><a name="OAuth2Credentials">class <strong>OAuth2Credentials</strong></a>(<a href="oauth2client.client.html#Credentials">Credentials</a>)</font></td></tr> |
| 465 | |
| 466 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 467 | <td colspan=2><tt><a href="#Credentials">Credentials</a> <a href="__builtin__.html#object">object</a> for OAuth 2.0<br> |
| 468 | <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 469 | <a href="#Credentials">Credentials</a> can be applied to an httplib2.Http <a href="__builtin__.html#object">object</a> using the <a href="#OAuth2Credentials-authorize">authorize</a>()<br> |
| 470 | method, which then signs each request from that <a href="__builtin__.html#object">object</a> with the OAuth 2.0<br> |
| 471 | access token.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 472 | <br> |
| 473 | <a href="#OAuth2Credentials">OAuth2Credentials</a> objects may be safely pickled and unpickled.<br> </tt></td></tr> |
| 474 | <tr><td> </td> |
| 475 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 476 | <dd><a href="oauth2client.client.html#OAuth2Credentials">OAuth2Credentials</a></dd> |
| 477 | <dd><a href="oauth2client.client.html#Credentials">Credentials</a></dd> |
| 478 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 479 | </dl> |
| 480 | <hr> |
| 481 | Methods defined here:<br> |
| 482 | <dl><dt><a name="OAuth2Credentials-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Trim the state down to something that can be pickled.</tt></dd></dl> |
| 483 | |
| 484 | <dl><dt><a name="OAuth2Credentials-__init__"><strong>__init__</strong></a>(self, access_token, client_id, client_secret, refresh_token, token_expiry, token_uri, user_agent)</dt><dd><tt>Create an instance of <a href="#OAuth2Credentials">OAuth2Credentials</a><br> |
| 485 | <br> |
| 486 | This constructor is not usually called by the user, instead<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 487 | <a href="#OAuth2Credentials">OAuth2Credentials</a> objects are instantiated by the <a href="#OAuth2WebServerFlow">OAuth2WebServerFlow</a>.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 488 | <br> |
| 489 | Args:<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 490 | token_uri: string, URI of token endpoint.<br> |
| 491 | client_id: string, client identifier.<br> |
| 492 | client_secret: string, client secret.<br> |
| 493 | access_token: string, access token.<br> |
| 494 | token_expiry: datetime, when the access_token expires.<br> |
| 495 | refresh_token: string, refresh token.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 496 | user_agent: string, The HTTP User-Agent to provide for this application.<br> |
| 497 | <br> |
| 498 | <br> |
| 499 | Notes:<br> |
| 500 | store: callable, a callable that when passed a Credential<br> |
| 501 | will store the credential back to where it came from.<br> |
| 502 | This is needed to store the latest access_token if it<br> |
| 503 | has expired and been refreshed.</tt></dd></dl> |
| 504 | |
| 505 | <dl><dt><a name="OAuth2Credentials-__setstate__"><strong>__setstate__</strong></a>(self, state)</dt><dd><tt>Reconstitute the state of the <a href="__builtin__.html#object">object</a> from being pickled.</tt></dd></dl> |
| 506 | |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 507 | <dl><dt><a name="OAuth2Credentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these credentials.<br> |
| 508 | <br> |
| 509 | Args:<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 510 | http: An instance of httplib2.Http<br> |
| 511 | or something that acts like it.<br> |
| 512 | <br> |
| 513 | Returns:<br> |
| 514 | A modified instance of http that was passed in.<br> |
| 515 | <br> |
| 516 | Example:<br> |
| 517 | <br> |
| 518 | h = httplib2.Http()<br> |
| 519 | h = credentials.<a href="#OAuth2Credentials-authorize">authorize</a>(h)<br> |
| 520 | <br> |
| 521 | You can't create a new OAuth<br> |
| 522 | subclass of httplib2.Authenication because<br> |
| 523 | it never gets passed the absolute URI, which is<br> |
| 524 | needed for signing. So instead we have to overload<br> |
| 525 | 'request' with a closure that adds in the<br> |
| 526 | Authorization header and then calls the original version<br> |
| 527 | of 'request()'.</tt></dd></dl> |
| 528 | |
| 529 | <dl><dt><a name="OAuth2Credentials-set_store"><strong>set_store</strong></a>(self, store)</dt><dd><tt>Set the storage for the credential.<br> |
| 530 | <br> |
| 531 | Args:<br> |
| 532 | store: callable, a callable that when passed a Credential<br> |
| 533 | will store the credential back to where it came from.<br> |
| 534 | This is needed to store the latest access_token if it<br> |
| 535 | has expired and been refreshed.</tt></dd></dl> |
| 536 | |
| 537 | <hr> |
Joe Gregorio | 9ce4b62 | 2011-02-17 15:32:11 -0500 | [diff] [blame] | 538 | Data descriptors defined here:<br> |
| 539 | <dl><dt><strong>invalid</strong></dt> |
| 540 | <dd><tt>True if the credentials are invalid, such as being revoked.</tt></dd> |
| 541 | </dl> |
| 542 | <hr> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 543 | Data descriptors inherited from <a href="oauth2client.client.html#Credentials">Credentials</a>:<br> |
| 544 | <dl><dt><strong>__dict__</strong></dt> |
| 545 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 546 | </dl> |
| 547 | <dl><dt><strong>__weakref__</strong></dt> |
| 548 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 549 | </dl> |
| 550 | </td></tr></table> <p> |
| 551 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 552 | <tr bgcolor="#ffc8d8"> |
| 553 | <td colspan=3 valign=bottom> <br> |
| 554 | <font color="#000000" face="helvetica, arial"><a name="OAuth2WebServerFlow">class <strong>OAuth2WebServerFlow</strong></a>(<a href="oauth2client.client.html#Flow">Flow</a>)</font></td></tr> |
| 555 | |
| 556 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 557 | <td colspan=2><tt>Does the Web Server <a href="#Flow">Flow</a> for OAuth 2.0.<br> |
| 558 | <br> |
| 559 | <a href="#OAuth2Credentials">OAuth2Credentials</a> objects may be safely pickled and unpickled.<br> </tt></td></tr> |
| 560 | <tr><td> </td> |
| 561 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 562 | <dd><a href="oauth2client.client.html#OAuth2WebServerFlow">OAuth2WebServerFlow</a></dd> |
| 563 | <dd><a href="oauth2client.client.html#Flow">Flow</a></dd> |
| 564 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 565 | </dl> |
| 566 | <hr> |
| 567 | Methods defined here:<br> |
Joe Gregorio | 4258d6b | 2011-03-18 10:20:16 -0400 | [diff] [blame] | 568 | <dl><dt><a name="OAuth2WebServerFlow-__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>, **kwargs)</dt><dd><tt>Constructor for <a href="#OAuth2WebServerFlow">OAuth2WebServerFlow</a><br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 569 | <br> |
| 570 | Args:<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 571 | client_id: string, client identifier.<br> |
| 572 | client_secret: string client secret.<br> |
| 573 | scope: string, scope of the credentials being requested.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 574 | user_agent: string, HTTP User-Agent to provide for this application.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 575 | auth_uri: string, URI for authorization endpoint. For convenience<br> |
| 576 | defaults to Google's endpoints but any OAuth 2.0 provider can be used.<br> |
| 577 | token_uri: string, URI for token endpoint. For convenience<br> |
| 578 | defaults to Google's endpoints but any OAuth 2.0 provider can be used.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 579 | **kwargs: dict, The keyword arguments are all optional and required<br> |
| 580 | parameters for the OAuth calls.</tt></dd></dl> |
| 581 | |
| 582 | <dl><dt><a name="OAuth2WebServerFlow-step1_get_authorize_url"><strong>step1_get_authorize_url</strong></a>(self, redirect_uri<font color="#909090">='oob'</font>)</dt><dd><tt>Returns a URI to redirect to the provider.<br> |
| 583 | <br> |
| 584 | Args:<br> |
| 585 | redirect_uri: string, Either the string 'oob' for a non-web-based<br> |
| 586 | application, or a URI that handles the callback from<br> |
| 587 | the authorization server.<br> |
| 588 | <br> |
| 589 | If redirect_uri is 'oob' then pass in the<br> |
| 590 | generated verification code to step2_exchange,<br> |
| 591 | otherwise pass in the query parameters received<br> |
| 592 | at the callback uri to step2_exchange.</tt></dd></dl> |
| 593 | |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 594 | <dl><dt><a name="OAuth2WebServerFlow-step2_exchange"><strong>step2_exchange</strong></a>(self, code, http<font color="#909090">=None</font>)</dt><dd><tt>Exhanges a code for <a href="#OAuth2Credentials">OAuth2Credentials</a>.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 595 | <br> |
| 596 | Args:<br> |
| 597 | code: string or dict, either the code as a string, or a dictionary<br> |
| 598 | of the query parameters to the redirect_uri, which contains<br> |
Joe Gregorio | f826111 | 2011-02-19 14:51:56 -0500 | [diff] [blame] | 599 | the code.<br> |
| 600 | http: httplib2.Http, optional http instance to use to do the fetch</tt></dd></dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 601 | |
| 602 | <hr> |
| 603 | Data descriptors inherited from <a href="oauth2client.client.html#Flow">Flow</a>:<br> |
| 604 | <dl><dt><strong>__dict__</strong></dt> |
| 605 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 606 | </dl> |
| 607 | <dl><dt><strong>__weakref__</strong></dt> |
| 608 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 609 | </dl> |
| 610 | </td></tr></table> <p> |
| 611 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 612 | <tr bgcolor="#ffc8d8"> |
| 613 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 614 | <font color="#000000" face="helvetica, arial"><a name="Storage">class <strong>Storage</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 615 | |
| 616 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 617 | <td colspan=2><tt>Base class for all <a href="#Storage">Storage</a> objects.<br> |
| 618 | <br> |
| 619 | Store and retrieve a single credential.<br> </tt></td></tr> |
| 620 | <tr><td> </td> |
| 621 | <td width="100%">Methods defined here:<br> |
| 622 | <dl><dt><a name="Storage-get"><strong>get</strong></a>(self)</dt><dd><tt>Retrieve credential.<br> |
| 623 | <br> |
| 624 | Returns:<br> |
Joe Gregorio | 20a5aa9 | 2011-04-01 17:44:25 -0400 | [diff] [blame] | 625 | oauth2client.client.<a href="#Credentials">Credentials</a></tt></dd></dl> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame] | 626 | |
| 627 | <dl><dt><a name="Storage-put"><strong>put</strong></a>(self, credentials)</dt><dd><tt>Write a credential.<br> |
| 628 | <br> |
| 629 | Args:<br> |
| 630 | credentials: <a href="#Credentials">Credentials</a>, the credentials to store.</tt></dd></dl> |
| 631 | |
| 632 | <hr> |
| 633 | Data descriptors defined here:<br> |
| 634 | <dl><dt><strong>__dict__</strong></dt> |
| 635 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 636 | </dl> |
| 637 | <dl><dt><strong>__weakref__</strong></dt> |
| 638 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 639 | </dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 640 | </td></tr></table></td></tr></table><p> |
| 641 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 642 | <tr bgcolor="#55aa55"> |
| 643 | <td colspan=3 valign=bottom> <br> |
| 644 | <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> |
| 645 | |
| 646 | <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> |
| 647 | <td width="100%"><strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p> |
| 648 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 649 | <tr bgcolor="#7799ee"> |
| 650 | <td colspan=3 valign=bottom> <br> |
| 651 | <font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr> |
| 652 | |
| 653 | <tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td> |
| 654 | <td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table> |
| 655 | </body></html> |