Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 1 | <?xml version="1.0" encoding="ascii"?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| 3 | "DTD/xhtml1-transitional.dtd"> |
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 5 | <head> |
| 6 | <title>oauth2client.client.OAuth2Credentials</title> |
| 7 | <link rel="stylesheet" href="epydoc.css" type="text/css" /> |
| 8 | <script type="text/javascript" src="epydoc.js"></script> |
| 9 | </head> |
| 10 | |
| 11 | <body bgcolor="white" text="black" link="blue" vlink="#204080" |
| 12 | alink="#204080"> |
| 13 | <!-- ==================== NAVIGATION BAR ==================== --> |
| 14 | <table class="navbar" border="0" width="100%" cellpadding="0" |
| 15 | bgcolor="#a0c0ff" cellspacing="0"> |
| 16 | <tr valign="middle"> |
| 17 | |
| 18 | <!-- Tree link --> |
| 19 | <th> <a |
| 20 | href="module-tree.html">Trees</a> </th> |
| 21 | |
| 22 | <!-- Index link --> |
| 23 | <th> <a |
| 24 | href="identifier-index.html">Indices</a> </th> |
| 25 | |
| 26 | <!-- Help link --> |
| 27 | <th> <a |
| 28 | href="help.html">Help</a> </th> |
| 29 | |
| 30 | <th class="navbar" width="100%"></th> |
| 31 | </tr> |
| 32 | </table> |
| 33 | <table width="100%" cellpadding="0" cellspacing="0"> |
| 34 | <tr valign="top"> |
| 35 | <td width="100%"> |
| 36 | <span class="breadcrumbs"> |
| 37 | <a href="oauth2client-module.html">Package oauth2client</a> :: |
| 38 | <a href="oauth2client.client-module.html">Module client</a> :: |
| 39 | Class OAuth2Credentials |
| 40 | </span> |
| 41 | </td> |
| 42 | <td> |
| 43 | <table cellpadding="0" cellspacing="0"> |
| 44 | <!-- hide/show private --> |
| 45 | <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" |
| 46 | onclick="toggle_private();">hide private</a>]</span></td></tr> |
| 47 | <tr><td align="right"><span class="options" |
| 48 | >[<a href="frames.html" target="_top">frames</a |
| 49 | >] | <a href="oauth2client.client.OAuth2Credentials-class.html" |
| 50 | target="_top">no frames</a>]</span></td></tr> |
| 51 | </table> |
| 52 | </td> |
| 53 | </tr> |
| 54 | </table> |
| 55 | <!-- ==================== CLASS DESCRIPTION ==================== --> |
| 56 | <h1 class="epydoc">Class OAuth2Credentials</h1><p class="nomargin-top"><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials">source code</a></span></p> |
| 57 | <center> |
Joe Gregorio | 37802c3 | 2013-08-06 12:24:05 -0400 | [diff] [blame^] | 58 | <center> <map id="uml_class_diagram_for_oauth2cl_25" name="uml_class_diagram_for_oauth2cl_25"> |
| 59 | <area shape="rect" id="node160" href="oauth2client.client.OAuth2Credentials-class.html#__init__" title="Create an instance of OAuth2Credentials." alt="" coords="17,129,969,148"/> |
| 60 | <area shape="rect" id="node160" href="oauth2client.client.OAuth2Credentials-class.html#authorize" title="Authorize an httplib2.Http instance with these credentials." alt="" coords="17,148,969,167"/> |
| 61 | <area shape="rect" id="node160" href="oauth2client.client.OAuth2Credentials-class.html#refresh" title="Forces a refresh of the access_token." alt="" coords="17,167,969,185"/> |
| 62 | <area shape="rect" id="node160" href="oauth2client.client.OAuth2Credentials-class.html#revoke" title="Revokes a refresh_token and makes the credentials void." alt="" coords="17,185,969,204"/> |
| 63 | <area shape="rect" id="node160" href="oauth2client.client.OAuth2Credentials-class.html#apply" title="Add the authorization to the headers." alt="" coords="17,204,969,223"/> |
| 64 | <area shape="rect" id="node160" href="oauth2client.client.OAuth2Credentials-class.html#to_json" title="Creating a JSON representation of an instance of Credentials." alt="" coords="17,223,969,241"/> |
| 65 | <area shape="rect" id="node160" href="oauth2client.client.OAuth2Credentials-class.html#from_json" title="Instantiate a Credentials object from a JSON description of it." alt="" coords="17,241,969,260"/> |
| 66 | <area shape="rect" id="node160" href="oauth2client.client.OAuth2Credentials-class.html#access_token_expired" title="True if the credential is expired or invalid." alt="" coords="17,260,969,279"/> |
| 67 | <area shape="rect" id="node160" href="oauth2client.client.OAuth2Credentials-class.html#set_store" title="Set the Storage for the credential." alt="" coords="17,279,969,297"/> |
| 68 | <area shape="rect" id="node160" href="oauth2client.client.OAuth2Credentials-class.html#__getstate__" title="Trim the state down to something that can be pickled." alt="" coords="17,297,969,316"/> |
| 69 | <area shape="rect" id="node160" href="oauth2client.client.OAuth2Credentials-class.html#__setstate__" title="Reconstitute the state of the object from being pickled." alt="" coords="17,316,969,335"/> |
| 70 | <area shape="rect" id="node1" href="oauth2client.client.OAuth2Credentials-class.html" title="Credentials object for OAuth 2.0." alt="" coords="5,97,981,341"/> |
| 71 | <area shape="rect" id="node161" href="oauth2client.client.Credentials-class.html#NON_SERIALIZED_MEMBERS" title="oauth2client.client.Credentials.NON_SERIALIZED_MEMBERS" alt="" coords="393,31,592,49"/> |
| 72 | <area shape="rect" id="node161" href="oauth2client.client.Credentials-class.html#new_from_json" title="Utility class method to instantiate a Credentials subclass from a JSON representation produced by to_json()." alt="" coords="393,52,592,71"/> |
| 73 | <area shape="rect" id="node2" href="oauth2client.client.Credentials-class.html" title="Base class for all Credentials objects." alt="" coords="381,6,603,77"/> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 74 | </map> |
Joe Gregorio | 37802c3 | 2013-08-06 12:24:05 -0400 | [diff] [blame^] | 75 | <img src="uml_class_diagram_for_oauth2cl_25.gif" alt='' usemap="#uml_class_diagram_for_oauth2cl_25" ismap="ismap" class="graph-without-title" /> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 76 | </center> |
| 77 | </center> |
| 78 | <hr /> |
| 79 | <pre class="literalblock"> |
| 80 | Credentials object for OAuth 2.0. |
| 81 | |
| 82 | Credentials can be applied to an httplib2.Http object using the authorize() |
| 83 | method, which then adds the OAuth 2.0 access token to each request. |
| 84 | |
| 85 | OAuth2Credentials objects may be safely pickled and unpickled. |
| 86 | |
| 87 | </pre> |
| 88 | |
| 89 | <!-- ==================== INSTANCE METHODS ==================== --> |
| 90 | <a name="section-InstanceMethods"></a> |
| 91 | <table class="summary" border="1" cellpadding="3" |
| 92 | cellspacing="0" width="100%" bgcolor="white"> |
| 93 | <tr bgcolor="#70b0f0" class="table-header"> |
| 94 | <td colspan="2" class="table-header"> |
| 95 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 96 | <tr valign="top"> |
| 97 | <td align="left"><span class="table-header">Instance Methods</span></td> |
| 98 | <td align="right" valign="top" |
| 99 | ><span class="options">[<a href="#section-InstanceMethods" |
| 100 | class="privatelink" onclick="toggle_private();" |
| 101 | >hide private</a>]</span></td> |
| 102 | </tr> |
| 103 | </table> |
| 104 | </td> |
| 105 | </tr> |
| 106 | <tr> |
| 107 | <td width="15%" align="right" valign="top" class="summary"> |
| 108 | <span class="summary-type"> </span> |
| 109 | </td><td class="summary"> |
| 110 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 111 | <tr> |
Joe Gregorio | f4839b0 | 2012-09-06 13:47:24 -0400 | [diff] [blame] | 112 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, |
| 113 | <span class="summary-sig-arg">access_token</span>, |
| 114 | <span class="summary-sig-arg">client_id</span>, |
| 115 | <span class="summary-sig-arg">client_secret</span>, |
| 116 | <span class="summary-sig-arg">refresh_token</span>, |
| 117 | <span class="summary-sig-arg">token_expiry</span>, |
| 118 | <span class="summary-sig-arg">token_uri</span>, |
| 119 | <span class="summary-sig-arg">user_agent</span>, |
Joe Gregorio | 41be8e8 | 2013-03-07 10:31:47 -0500 | [diff] [blame] | 120 | <span class="summary-sig-arg">revoke_uri</span>=<span class="summary-sig-default">None</span>, |
| 121 | <span class="summary-sig-arg">id_token</span>=<span class="summary-sig-default">None</span>, |
| 122 | <span class="summary-sig-arg">token_response</span>=<span class="summary-sig-default">None</span>)</span><br /> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 123 | Create an instance of OAuth2Credentials.</td> |
| 124 | <td align="right" valign="top"> |
Joe Gregorio | f4839b0 | 2012-09-06 13:47:24 -0400 | [diff] [blame] | 125 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.__init__">source code</a></span> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 126 | |
| 127 | </td> |
| 128 | </tr> |
| 129 | </table> |
| 130 | |
| 131 | </td> |
| 132 | </tr> |
| 133 | <tr> |
| 134 | <td width="15%" align="right" valign="top" class="summary"> |
| 135 | <span class="summary-type"> </span> |
| 136 | </td><td class="summary"> |
| 137 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 138 | <tr> |
| 139 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#authorize" class="summary-sig-name">authorize</a>(<span class="summary-sig-arg">self</span>, |
| 140 | <span class="summary-sig-arg">http</span>)</span><br /> |
| 141 | Authorize an httplib2.Http instance with these credentials.</td> |
| 142 | <td align="right" valign="top"> |
| 143 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.authorize">source code</a></span> |
| 144 | |
| 145 | </td> |
| 146 | </tr> |
| 147 | </table> |
| 148 | |
| 149 | </td> |
| 150 | </tr> |
| 151 | <tr> |
| 152 | <td width="15%" align="right" valign="top" class="summary"> |
| 153 | <span class="summary-type"> </span> |
| 154 | </td><td class="summary"> |
| 155 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 156 | <tr> |
| 157 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#refresh" class="summary-sig-name">refresh</a>(<span class="summary-sig-arg">self</span>, |
| 158 | <span class="summary-sig-arg">http</span>)</span><br /> |
| 159 | Forces a refresh of the access_token.</td> |
| 160 | <td align="right" valign="top"> |
| 161 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.refresh">source code</a></span> |
| 162 | |
| 163 | </td> |
| 164 | </tr> |
| 165 | </table> |
| 166 | |
| 167 | </td> |
| 168 | </tr> |
| 169 | <tr> |
| 170 | <td width="15%" align="right" valign="top" class="summary"> |
| 171 | <span class="summary-type"> </span> |
| 172 | </td><td class="summary"> |
| 173 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 174 | <tr> |
Joe Gregorio | 41be8e8 | 2013-03-07 10:31:47 -0500 | [diff] [blame] | 175 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#revoke" class="summary-sig-name">revoke</a>(<span class="summary-sig-arg">self</span>, |
| 176 | <span class="summary-sig-arg">http</span>)</span><br /> |
| 177 | Revokes a refresh_token and makes the credentials void.</td> |
| 178 | <td align="right" valign="top"> |
| 179 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.revoke">source code</a></span> |
| 180 | |
| 181 | </td> |
| 182 | </tr> |
| 183 | </table> |
| 184 | |
| 185 | </td> |
| 186 | </tr> |
| 187 | <tr> |
| 188 | <td width="15%" align="right" valign="top" class="summary"> |
| 189 | <span class="summary-type"> </span> |
| 190 | </td><td class="summary"> |
| 191 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 192 | <tr> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 193 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#apply" class="summary-sig-name">apply</a>(<span class="summary-sig-arg">self</span>, |
| 194 | <span class="summary-sig-arg">headers</span>)</span><br /> |
| 195 | Add the authorization to the headers.</td> |
| 196 | <td align="right" valign="top"> |
| 197 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.apply">source code</a></span> |
| 198 | |
| 199 | </td> |
| 200 | </tr> |
| 201 | </table> |
| 202 | |
| 203 | </td> |
| 204 | </tr> |
| 205 | <tr> |
| 206 | <td width="15%" align="right" valign="top" class="summary"> |
| 207 | <span class="summary-type"> </span> |
| 208 | </td><td class="summary"> |
| 209 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 210 | <tr> |
| 211 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#to_json" class="summary-sig-name">to_json</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
| 212 | Creating a JSON representation of an instance of Credentials.</td> |
| 213 | <td align="right" valign="top"> |
| 214 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.to_json">source code</a></span> |
| 215 | |
| 216 | </td> |
| 217 | </tr> |
| 218 | </table> |
| 219 | |
| 220 | </td> |
| 221 | </tr> |
| 222 | <tr> |
| 223 | <td width="15%" align="right" valign="top" class="summary"> |
| 224 | <span class="summary-type"> </span> |
| 225 | </td><td class="summary"> |
| 226 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 227 | <tr> |
Joe Gregorio | f4839b0 | 2012-09-06 13:47:24 -0400 | [diff] [blame] | 228 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#access_token_expired" class="summary-sig-name">access_token_expired</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
| 229 | True if the credential is expired or invalid.</td> |
| 230 | <td align="right" valign="top"> |
| 231 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.access_token_expired">source code</a></span> |
| 232 | |
| 233 | </td> |
| 234 | </tr> |
| 235 | </table> |
| 236 | |
| 237 | </td> |
| 238 | </tr> |
| 239 | <tr> |
| 240 | <td width="15%" align="right" valign="top" class="summary"> |
| 241 | <span class="summary-type"> </span> |
| 242 | </td><td class="summary"> |
| 243 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 244 | <tr> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 245 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#set_store" class="summary-sig-name">set_store</a>(<span class="summary-sig-arg">self</span>, |
| 246 | <span class="summary-sig-arg">store</span>)</span><br /> |
| 247 | Set the Storage for the credential.</td> |
| 248 | <td align="right" valign="top"> |
| 249 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.set_store">source code</a></span> |
| 250 | |
| 251 | </td> |
| 252 | </tr> |
| 253 | </table> |
| 254 | |
| 255 | </td> |
| 256 | </tr> |
| 257 | <tr class="private"> |
| 258 | <td width="15%" align="right" valign="top" class="summary"> |
| 259 | <span class="summary-type"> </span> |
| 260 | </td><td class="summary"> |
| 261 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 262 | <tr> |
| 263 | <td><span class="summary-sig"><a name="_updateFromCredential"></a><span class="summary-sig-name">_updateFromCredential</span>(<span class="summary-sig-arg">self</span>, |
| 264 | <span class="summary-sig-arg">other</span>)</span><br /> |
| 265 | Update this Credential from another instance.</td> |
| 266 | <td align="right" valign="top"> |
| 267 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials._updateFromCredential">source code</a></span> |
| 268 | |
| 269 | </td> |
| 270 | </tr> |
| 271 | </table> |
| 272 | |
| 273 | </td> |
| 274 | </tr> |
| 275 | <tr> |
| 276 | <td width="15%" align="right" valign="top" class="summary"> |
| 277 | <span class="summary-type"> </span> |
| 278 | </td><td class="summary"> |
| 279 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 280 | <tr> |
| 281 | <td><span class="summary-sig"><a name="__getstate__"></a><span class="summary-sig-name">__getstate__</span>(<span class="summary-sig-arg">self</span>)</span><br /> |
| 282 | Trim the state down to something that can be pickled.</td> |
| 283 | <td align="right" valign="top"> |
| 284 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.__getstate__">source code</a></span> |
| 285 | |
| 286 | </td> |
| 287 | </tr> |
| 288 | </table> |
| 289 | |
| 290 | </td> |
| 291 | </tr> |
| 292 | <tr> |
| 293 | <td width="15%" align="right" valign="top" class="summary"> |
| 294 | <span class="summary-type"> </span> |
| 295 | </td><td class="summary"> |
| 296 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 297 | <tr> |
| 298 | <td><span class="summary-sig"><a name="__setstate__"></a><span class="summary-sig-name">__setstate__</span>(<span class="summary-sig-arg">self</span>, |
| 299 | <span class="summary-sig-arg">state</span>)</span><br /> |
| 300 | Reconstitute the state of the object from being pickled.</td> |
| 301 | <td align="right" valign="top"> |
| 302 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.__setstate__">source code</a></span> |
| 303 | |
| 304 | </td> |
| 305 | </tr> |
| 306 | </table> |
| 307 | |
| 308 | </td> |
| 309 | </tr> |
| 310 | <tr class="private"> |
| 311 | <td width="15%" align="right" valign="top" class="summary"> |
| 312 | <span class="summary-type"> </span> |
| 313 | </td><td class="summary"> |
| 314 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 315 | <tr> |
| 316 | <td><span class="summary-sig"><a name="_generate_refresh_request_body"></a><span class="summary-sig-name">_generate_refresh_request_body</span>(<span class="summary-sig-arg">self</span>)</span><br /> |
| 317 | Generate the body that will be used in the refresh request.</td> |
| 318 | <td align="right" valign="top"> |
| 319 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials._generate_refresh_request_body">source code</a></span> |
| 320 | |
| 321 | </td> |
| 322 | </tr> |
| 323 | </table> |
| 324 | |
| 325 | </td> |
| 326 | </tr> |
| 327 | <tr class="private"> |
| 328 | <td width="15%" align="right" valign="top" class="summary"> |
| 329 | <span class="summary-type"> </span> |
| 330 | </td><td class="summary"> |
| 331 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 332 | <tr> |
| 333 | <td><span class="summary-sig"><a name="_generate_refresh_request_headers"></a><span class="summary-sig-name">_generate_refresh_request_headers</span>(<span class="summary-sig-arg">self</span>)</span><br /> |
| 334 | Generate the headers that will be used in the refresh request.</td> |
| 335 | <td align="right" valign="top"> |
| 336 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials._generate_refresh_request_headers">source code</a></span> |
| 337 | |
| 338 | </td> |
| 339 | </tr> |
| 340 | </table> |
| 341 | |
| 342 | </td> |
| 343 | </tr> |
| 344 | <tr class="private"> |
| 345 | <td width="15%" align="right" valign="top" class="summary"> |
| 346 | <span class="summary-type"> </span> |
| 347 | </td><td class="summary"> |
| 348 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 349 | <tr> |
| 350 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#_refresh" class="summary-sig-name" onclick="show_private();">_refresh</a>(<span class="summary-sig-arg">self</span>, |
| 351 | <span class="summary-sig-arg">http_request</span>)</span><br /> |
| 352 | Refreshes the access_token.</td> |
| 353 | <td align="right" valign="top"> |
| 354 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials._refresh">source code</a></span> |
| 355 | |
| 356 | </td> |
| 357 | </tr> |
| 358 | </table> |
| 359 | |
| 360 | </td> |
| 361 | </tr> |
| 362 | <tr class="private"> |
| 363 | <td width="15%" align="right" valign="top" class="summary"> |
| 364 | <span class="summary-type"> </span> |
| 365 | </td><td class="summary"> |
| 366 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 367 | <tr> |
| 368 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#_do_refresh_request" class="summary-sig-name" onclick="show_private();">_do_refresh_request</a>(<span class="summary-sig-arg">self</span>, |
| 369 | <span class="summary-sig-arg">http_request</span>)</span><br /> |
| 370 | Refresh the access_token using the refresh_token.</td> |
| 371 | <td align="right" valign="top"> |
| 372 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials._do_refresh_request">source code</a></span> |
| 373 | |
| 374 | </td> |
| 375 | </tr> |
| 376 | </table> |
| 377 | |
| 378 | </td> |
| 379 | </tr> |
Joe Gregorio | 41be8e8 | 2013-03-07 10:31:47 -0500 | [diff] [blame] | 380 | <tr class="private"> |
| 381 | <td width="15%" align="right" valign="top" class="summary"> |
| 382 | <span class="summary-type"> </span> |
| 383 | </td><td class="summary"> |
| 384 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 385 | <tr> |
| 386 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#_revoke" class="summary-sig-name" onclick="show_private();">_revoke</a>(<span class="summary-sig-arg">self</span>, |
| 387 | <span class="summary-sig-arg">http_request</span>)</span><br /> |
| 388 | Revokes the refresh_token and deletes the store if available.</td> |
| 389 | <td align="right" valign="top"> |
| 390 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials._revoke">source code</a></span> |
| 391 | |
| 392 | </td> |
| 393 | </tr> |
| 394 | </table> |
| 395 | |
| 396 | </td> |
| 397 | </tr> |
| 398 | <tr class="private"> |
| 399 | <td width="15%" align="right" valign="top" class="summary"> |
| 400 | <span class="summary-type"> </span> |
| 401 | </td><td class="summary"> |
| 402 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 403 | <tr> |
| 404 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#_do_revoke" class="summary-sig-name" onclick="show_private();">_do_revoke</a>(<span class="summary-sig-arg">self</span>, |
| 405 | <span class="summary-sig-arg">http_request</span>, |
| 406 | <span class="summary-sig-arg">token</span>)</span><br /> |
| 407 | Revokes the credentials and deletes the store if available.</td> |
| 408 | <td align="right" valign="top"> |
| 409 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials._do_revoke">source code</a></span> |
| 410 | |
| 411 | </td> |
| 412 | </tr> |
| 413 | </table> |
| 414 | |
| 415 | </td> |
| 416 | </tr> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 417 | <tr> |
| 418 | <td colspan="2" class="summary"> |
| 419 | <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.Credentials-class.html">Credentials</a></code></b> (private): |
| 420 | <code><a href="oauth2client.client.Credentials-class.html#_to_json" onclick="show_private();">_to_json</a></code> |
| 421 | </p></div> |
| 422 | <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
| 423 | <code>__delattr__</code>, |
| 424 | <code>__format__</code>, |
| 425 | <code>__getattribute__</code>, |
| 426 | <code>__hash__</code>, |
| 427 | <code>__new__</code>, |
| 428 | <code>__reduce__</code>, |
| 429 | <code>__reduce_ex__</code>, |
| 430 | <code>__repr__</code>, |
| 431 | <code>__setattr__</code>, |
| 432 | <code>__sizeof__</code>, |
| 433 | <code>__str__</code>, |
| 434 | <code>__subclasshook__</code> |
| 435 | </p> |
| 436 | </td> |
| 437 | </tr> |
| 438 | </table> |
| 439 | <!-- ==================== CLASS METHODS ==================== --> |
| 440 | <a name="section-ClassMethods"></a> |
| 441 | <table class="summary" border="1" cellpadding="3" |
| 442 | cellspacing="0" width="100%" bgcolor="white"> |
| 443 | <tr bgcolor="#70b0f0" class="table-header"> |
| 444 | <td colspan="2" class="table-header"> |
| 445 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 446 | <tr valign="top"> |
| 447 | <td align="left"><span class="table-header">Class Methods</span></td> |
| 448 | <td align="right" valign="top" |
| 449 | ><span class="options">[<a href="#section-ClassMethods" |
| 450 | class="privatelink" onclick="toggle_private();" |
| 451 | >hide private</a>]</span></td> |
| 452 | </tr> |
| 453 | </table> |
| 454 | </td> |
| 455 | </tr> |
| 456 | <tr> |
| 457 | <td width="15%" align="right" valign="top" class="summary"> |
| 458 | <span class="summary-type"> </span> |
| 459 | </td><td class="summary"> |
| 460 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 461 | <tr> |
| 462 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2Credentials-class.html#from_json" class="summary-sig-name">from_json</a>(<span class="summary-sig-arg">cls</span>, |
| 463 | <span class="summary-sig-arg">s</span>)</span><br /> |
| 464 | Instantiate a Credentials object from a JSON description of it.</td> |
| 465 | <td align="right" valign="top"> |
| 466 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.from_json">source code</a></span> |
| 467 | |
| 468 | </td> |
| 469 | </tr> |
| 470 | </table> |
| 471 | |
| 472 | </td> |
| 473 | </tr> |
| 474 | <tr> |
| 475 | <td colspan="2" class="summary"> |
| 476 | <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.Credentials-class.html">Credentials</a></code></b>: |
| 477 | <code><a href="oauth2client.client.Credentials-class.html#new_from_json">new_from_json</a></code> |
| 478 | </p> |
| 479 | </td> |
| 480 | </tr> |
| 481 | </table> |
| 482 | <!-- ==================== CLASS VARIABLES ==================== --> |
| 483 | <a name="section-ClassVariables"></a> |
| 484 | <table class="summary" border="1" cellpadding="3" |
| 485 | cellspacing="0" width="100%" bgcolor="white"> |
| 486 | <tr bgcolor="#70b0f0" class="table-header"> |
| 487 | <td colspan="2" class="table-header"> |
| 488 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 489 | <tr valign="top"> |
| 490 | <td align="left"><span class="table-header">Class Variables</span></td> |
| 491 | <td align="right" valign="top" |
| 492 | ><span class="options">[<a href="#section-ClassVariables" |
| 493 | class="privatelink" onclick="toggle_private();" |
| 494 | >hide private</a>]</span></td> |
| 495 | </tr> |
| 496 | </table> |
| 497 | </td> |
| 498 | </tr> |
| 499 | <tr> |
| 500 | <td colspan="2" class="summary"> |
| 501 | <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.Credentials-class.html">Credentials</a></code></b>: |
| 502 | <code><a href="oauth2client.client.Credentials-class.html#NON_SERIALIZED_MEMBERS">NON_SERIALIZED_MEMBERS</a></code> |
| 503 | </p> |
| 504 | </td> |
| 505 | </tr> |
| 506 | </table> |
| 507 | <!-- ==================== PROPERTIES ==================== --> |
| 508 | <a name="section-Properties"></a> |
| 509 | <table class="summary" border="1" cellpadding="3" |
| 510 | cellspacing="0" width="100%" bgcolor="white"> |
| 511 | <tr bgcolor="#70b0f0" class="table-header"> |
| 512 | <td colspan="2" class="table-header"> |
| 513 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 514 | <tr valign="top"> |
| 515 | <td align="left"><span class="table-header">Properties</span></td> |
| 516 | <td align="right" valign="top" |
| 517 | ><span class="options">[<a href="#section-Properties" |
| 518 | class="privatelink" onclick="toggle_private();" |
| 519 | >hide private</a>]</span></td> |
| 520 | </tr> |
| 521 | </table> |
| 522 | </td> |
| 523 | </tr> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 524 | <tr> |
| 525 | <td colspan="2" class="summary"> |
| 526 | <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
| 527 | <code>__class__</code> |
| 528 | </p> |
| 529 | </td> |
| 530 | </tr> |
| 531 | </table> |
| 532 | <!-- ==================== METHOD DETAILS ==================== --> |
| 533 | <a name="section-MethodDetails"></a> |
| 534 | <table class="details" border="1" cellpadding="3" |
| 535 | cellspacing="0" width="100%" bgcolor="white"> |
| 536 | <tr bgcolor="#70b0f0" class="table-header"> |
| 537 | <td colspan="2" class="table-header"> |
| 538 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 539 | <tr valign="top"> |
| 540 | <td align="left"><span class="table-header">Method Details</span></td> |
| 541 | <td align="right" valign="top" |
| 542 | ><span class="options">[<a href="#section-MethodDetails" |
| 543 | class="privatelink" onclick="toggle_private();" |
| 544 | >hide private</a>]</span></td> |
| 545 | </tr> |
| 546 | </table> |
| 547 | </td> |
| 548 | </tr> |
| 549 | </table> |
| 550 | <a name="__init__"></a> |
| 551 | <div> |
| 552 | <table class="details" border="1" cellpadding="3" |
| 553 | cellspacing="0" width="100%" bgcolor="white"> |
| 554 | <tr><td> |
| 555 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 556 | <tr valign="top"><td> |
Joe Gregorio | f4839b0 | 2012-09-06 13:47:24 -0400 | [diff] [blame] | 557 | <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, |
| 558 | <span class="sig-arg">access_token</span>, |
| 559 | <span class="sig-arg">client_id</span>, |
| 560 | <span class="sig-arg">client_secret</span>, |
| 561 | <span class="sig-arg">refresh_token</span>, |
| 562 | <span class="sig-arg">token_expiry</span>, |
| 563 | <span class="sig-arg">token_uri</span>, |
| 564 | <span class="sig-arg">user_agent</span>, |
Joe Gregorio | 41be8e8 | 2013-03-07 10:31:47 -0500 | [diff] [blame] | 565 | <span class="sig-arg">revoke_uri</span>=<span class="sig-default">None</span>, |
| 566 | <span class="sig-arg">id_token</span>=<span class="sig-default">None</span>, |
| 567 | <span class="sig-arg">token_response</span>=<span class="sig-default">None</span>)</span> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 568 | <br /><em class="fname">(Constructor)</em> |
| 569 | </h3> |
| 570 | </td><td align="right" valign="top" |
Joe Gregorio | f4839b0 | 2012-09-06 13:47:24 -0400 | [diff] [blame] | 571 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.__init__">source code</a></span> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 572 | </td> |
| 573 | </tr></table> |
| 574 | |
| 575 | <pre class="literalblock"> |
| 576 | Create an instance of OAuth2Credentials. |
| 577 | |
| 578 | This constructor is not usually called by the user, instead |
| 579 | OAuth2Credentials objects are instantiated by the OAuth2WebServerFlow. |
| 580 | |
| 581 | Args: |
| 582 | access_token: string, access token. |
| 583 | client_id: string, client identifier. |
| 584 | client_secret: string, client secret. |
| 585 | refresh_token: string, refresh token. |
| 586 | token_expiry: datetime, when the access_token expires. |
| 587 | token_uri: string, URI of token endpoint. |
| 588 | user_agent: string, The HTTP User-Agent to provide for this application. |
Joe Gregorio | 41be8e8 | 2013-03-07 10:31:47 -0500 | [diff] [blame] | 589 | revoke_uri: string, URI for revoke endpoint. Defaults to None; a token |
| 590 | can't be revoked if this is None. |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 591 | id_token: object, The identity of the resource owner. |
Joe Gregorio | 41be8e8 | 2013-03-07 10:31:47 -0500 | [diff] [blame] | 592 | token_response: dict, the decoded response to the token request. None |
| 593 | if a token hasn't been requested yet. Stored because some providers |
| 594 | (e.g. wordpress.com) include extra fields that clients may want. |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 595 | |
| 596 | Notes: |
| 597 | store: callable, A callable that when passed a Credential |
| 598 | will store the credential back to where it came from. |
| 599 | This is needed to store the latest access_token if it |
| 600 | has expired and been refreshed. |
| 601 | |
| 602 | </pre> |
| 603 | <dl class="fields"> |
Joe Gregorio | 1b425aa | 2012-08-24 12:04:34 -0400 | [diff] [blame] | 604 | <dt>Decorators:</dt> |
| 605 | <dd><ul class="nomargin-top"> |
| 606 | <li><code>@util.positional(8)</code></li> |
| 607 | </ul></dd> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 608 | <dt>Overrides: |
| 609 | object.__init__ |
| 610 | </dt> |
| 611 | </dl> |
| 612 | </td></tr></table> |
| 613 | </div> |
| 614 | <a name="authorize"></a> |
| 615 | <div> |
| 616 | <table class="details" border="1" cellpadding="3" |
| 617 | cellspacing="0" width="100%" bgcolor="white"> |
| 618 | <tr><td> |
| 619 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 620 | <tr valign="top"><td> |
| 621 | <h3 class="epydoc"><span class="sig"><span class="sig-name">authorize</span>(<span class="sig-arg">self</span>, |
| 622 | <span class="sig-arg">http</span>)</span> |
| 623 | </h3> |
| 624 | </td><td align="right" valign="top" |
| 625 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.authorize">source code</a></span> |
| 626 | </td> |
| 627 | </tr></table> |
| 628 | |
| 629 | <pre class="literalblock"> |
| 630 | Authorize an httplib2.Http instance with these credentials. |
| 631 | |
| 632 | The modified http.request method will add authentication headers to each |
| 633 | request and will refresh access_tokens when a 401 is received on a |
| 634 | request. In addition the http.request method has a credentials property, |
| 635 | http.request.credentials, which is the Credentials object that authorized |
| 636 | it. |
| 637 | |
| 638 | Args: |
| 639 | http: An instance of httplib2.Http |
Joe Gregorio | 41be8e8 | 2013-03-07 10:31:47 -0500 | [diff] [blame] | 640 | or something that acts like it. |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 641 | |
| 642 | Returns: |
| 643 | A modified instance of http that was passed in. |
| 644 | |
| 645 | Example: |
| 646 | |
| 647 | h = httplib2.Http() |
| 648 | h = credentials.authorize(h) |
| 649 | |
| 650 | You can't create a new OAuth subclass of httplib2.Authenication |
| 651 | because it never gets passed the absolute URI, which is needed for |
| 652 | signing. So instead we have to overload 'request' with a closure |
| 653 | that adds in the Authorization header and then calls the original |
| 654 | version of 'request()'. |
| 655 | |
| 656 | </pre> |
| 657 | <dl class="fields"> |
| 658 | <dt>Overrides: |
| 659 | <a href="oauth2client.client.Credentials-class.html#authorize">Credentials.authorize</a> |
| 660 | </dt> |
| 661 | </dl> |
| 662 | </td></tr></table> |
| 663 | </div> |
| 664 | <a name="refresh"></a> |
| 665 | <div> |
| 666 | <table class="details" border="1" cellpadding="3" |
| 667 | cellspacing="0" width="100%" bgcolor="white"> |
| 668 | <tr><td> |
| 669 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 670 | <tr valign="top"><td> |
| 671 | <h3 class="epydoc"><span class="sig"><span class="sig-name">refresh</span>(<span class="sig-arg">self</span>, |
| 672 | <span class="sig-arg">http</span>)</span> |
| 673 | </h3> |
| 674 | </td><td align="right" valign="top" |
| 675 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.refresh">source code</a></span> |
| 676 | </td> |
| 677 | </tr></table> |
| 678 | |
| 679 | <pre class="literalblock"> |
| 680 | Forces a refresh of the access_token. |
| 681 | |
| 682 | Args: |
| 683 | http: httplib2.Http, an http object to be used to make the refresh |
| 684 | request. |
| 685 | |
| 686 | </pre> |
| 687 | <dl class="fields"> |
| 688 | <dt>Overrides: |
| 689 | <a href="oauth2client.client.Credentials-class.html#refresh">Credentials.refresh</a> |
| 690 | </dt> |
| 691 | </dl> |
| 692 | </td></tr></table> |
| 693 | </div> |
Joe Gregorio | 41be8e8 | 2013-03-07 10:31:47 -0500 | [diff] [blame] | 694 | <a name="revoke"></a> |
| 695 | <div> |
| 696 | <table class="details" border="1" cellpadding="3" |
| 697 | cellspacing="0" width="100%" bgcolor="white"> |
| 698 | <tr><td> |
| 699 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 700 | <tr valign="top"><td> |
| 701 | <h3 class="epydoc"><span class="sig"><span class="sig-name">revoke</span>(<span class="sig-arg">self</span>, |
| 702 | <span class="sig-arg">http</span>)</span> |
| 703 | </h3> |
| 704 | </td><td align="right" valign="top" |
| 705 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.revoke">source code</a></span> |
| 706 | </td> |
| 707 | </tr></table> |
| 708 | |
| 709 | <pre class="literalblock"> |
| 710 | Revokes a refresh_token and makes the credentials void. |
| 711 | |
| 712 | Args: |
| 713 | http: httplib2.Http, an http object to be used to make the revoke |
| 714 | request. |
| 715 | |
| 716 | </pre> |
| 717 | <dl class="fields"> |
| 718 | <dt>Overrides: |
| 719 | <a href="oauth2client.client.Credentials-class.html#revoke">Credentials.revoke</a> |
| 720 | </dt> |
| 721 | </dl> |
| 722 | </td></tr></table> |
| 723 | </div> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 724 | <a name="apply"></a> |
| 725 | <div> |
| 726 | <table class="details" border="1" cellpadding="3" |
| 727 | cellspacing="0" width="100%" bgcolor="white"> |
| 728 | <tr><td> |
| 729 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 730 | <tr valign="top"><td> |
| 731 | <h3 class="epydoc"><span class="sig"><span class="sig-name">apply</span>(<span class="sig-arg">self</span>, |
| 732 | <span class="sig-arg">headers</span>)</span> |
| 733 | </h3> |
| 734 | </td><td align="right" valign="top" |
| 735 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.apply">source code</a></span> |
| 736 | </td> |
| 737 | </tr></table> |
| 738 | |
| 739 | <pre class="literalblock"> |
| 740 | Add the authorization to the headers. |
| 741 | |
| 742 | Args: |
| 743 | headers: dict, the headers to add the Authorization header to. |
| 744 | |
| 745 | </pre> |
| 746 | <dl class="fields"> |
| 747 | <dt>Overrides: |
| 748 | <a href="oauth2client.client.Credentials-class.html#apply">Credentials.apply</a> |
| 749 | </dt> |
| 750 | </dl> |
| 751 | </td></tr></table> |
| 752 | </div> |
| 753 | <a name="to_json"></a> |
| 754 | <div> |
| 755 | <table class="details" border="1" cellpadding="3" |
| 756 | cellspacing="0" width="100%" bgcolor="white"> |
| 757 | <tr><td> |
| 758 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 759 | <tr valign="top"><td> |
| 760 | <h3 class="epydoc"><span class="sig"><span class="sig-name">to_json</span>(<span class="sig-arg">self</span>)</span> |
| 761 | </h3> |
| 762 | </td><td align="right" valign="top" |
| 763 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.to_json">source code</a></span> |
| 764 | </td> |
| 765 | </tr></table> |
| 766 | |
| 767 | <pre class="literalblock"> |
| 768 | Creating a JSON representation of an instance of Credentials. |
| 769 | |
| 770 | Returns: |
| 771 | string, a JSON representation of this instance, suitable to pass to |
| 772 | from_json(). |
| 773 | |
| 774 | </pre> |
| 775 | <dl class="fields"> |
| 776 | <dt>Overrides: |
| 777 | <a href="oauth2client.client.Credentials-class.html#to_json">Credentials.to_json</a> |
| 778 | <dd><em class="note">(inherited documentation)</em></dd> |
| 779 | </dt> |
| 780 | </dl> |
| 781 | </td></tr></table> |
| 782 | </div> |
| 783 | <a name="from_json"></a> |
| 784 | <div> |
| 785 | <table class="details" border="1" cellpadding="3" |
| 786 | cellspacing="0" width="100%" bgcolor="white"> |
| 787 | <tr><td> |
| 788 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 789 | <tr valign="top"><td> |
| 790 | <h3 class="epydoc"><span class="sig"><span class="sig-name">from_json</span>(<span class="sig-arg">cls</span>, |
| 791 | <span class="sig-arg">s</span>)</span> |
| 792 | <br /><em class="fname">Class Method</em> |
| 793 | </h3> |
| 794 | </td><td align="right" valign="top" |
| 795 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.from_json">source code</a></span> |
| 796 | </td> |
| 797 | </tr></table> |
| 798 | |
| 799 | <pre class="literalblock"> |
| 800 | Instantiate a Credentials object from a JSON description of it. The JSON |
| 801 | should have been produced by calling .to_json() on the object. |
| 802 | |
| 803 | Args: |
| 804 | data: dict, A deserialized JSON object. |
| 805 | |
| 806 | Returns: |
| 807 | An instance of a Credentials subclass. |
| 808 | |
| 809 | </pre> |
| 810 | <dl class="fields"> |
| 811 | <dt>Overrides: |
| 812 | <a href="oauth2client.client.Credentials-class.html#from_json">Credentials.from_json</a> |
| 813 | </dt> |
| 814 | </dl> |
| 815 | </td></tr></table> |
| 816 | </div> |
Joe Gregorio | f4839b0 | 2012-09-06 13:47:24 -0400 | [diff] [blame] | 817 | <a name="access_token_expired"></a> |
| 818 | <div> |
| 819 | <table class="details" border="1" cellpadding="3" |
| 820 | cellspacing="0" width="100%" bgcolor="white"> |
| 821 | <tr><td> |
| 822 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 823 | <tr valign="top"><td> |
| 824 | <h3 class="epydoc"><span class="sig"><span class="sig-name">access_token_expired</span>(<span class="sig-arg">self</span>)</span> |
| 825 | </h3> |
| 826 | </td><td align="right" valign="top" |
| 827 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.access_token_expired">source code</a></span> |
| 828 | </td> |
| 829 | </tr></table> |
| 830 | |
| 831 | <pre class="literalblock"> |
| 832 | True if the credential is expired or invalid. |
| 833 | |
| 834 | If the token_expiry isn't set, we assume the token doesn't expire. |
| 835 | |
| 836 | </pre> |
| 837 | <dl class="fields"> |
| 838 | <dt>Decorators:</dt> |
| 839 | <dd><ul class="nomargin-top"> |
| 840 | <li><code>@property</code></li> |
| 841 | </ul></dd> |
| 842 | </dl> |
| 843 | </td></tr></table> |
| 844 | </div> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 845 | <a name="set_store"></a> |
| 846 | <div> |
| 847 | <table class="details" border="1" cellpadding="3" |
| 848 | cellspacing="0" width="100%" bgcolor="white"> |
| 849 | <tr><td> |
| 850 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 851 | <tr valign="top"><td> |
| 852 | <h3 class="epydoc"><span class="sig"><span class="sig-name">set_store</span>(<span class="sig-arg">self</span>, |
| 853 | <span class="sig-arg">store</span>)</span> |
| 854 | </h3> |
| 855 | </td><td align="right" valign="top" |
| 856 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials.set_store">source code</a></span> |
| 857 | </td> |
| 858 | </tr></table> |
| 859 | |
| 860 | <pre class="literalblock"> |
| 861 | Set the Storage for the credential. |
| 862 | |
| 863 | Args: |
| 864 | store: Storage, an implementation of Stroage object. |
| 865 | This is needed to store the latest access_token if it |
Joe Gregorio | 52a5c53 | 2013-01-24 16:19:07 -0500 | [diff] [blame] | 866 | has expired and been refreshed. This implementation uses |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 867 | locking to check for updates before updating the |
| 868 | access_token. |
| 869 | |
| 870 | </pre> |
| 871 | <dl class="fields"> |
| 872 | </dl> |
| 873 | </td></tr></table> |
| 874 | </div> |
| 875 | <a name="_refresh"></a> |
| 876 | <div class="private"> |
| 877 | <table class="details" border="1" cellpadding="3" |
| 878 | cellspacing="0" width="100%" bgcolor="white"> |
| 879 | <tr><td> |
| 880 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 881 | <tr valign="top"><td> |
| 882 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_refresh</span>(<span class="sig-arg">self</span>, |
| 883 | <span class="sig-arg">http_request</span>)</span> |
| 884 | </h3> |
| 885 | </td><td align="right" valign="top" |
| 886 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials._refresh">source code</a></span> |
| 887 | </td> |
| 888 | </tr></table> |
| 889 | |
| 890 | <pre class="literalblock"> |
| 891 | Refreshes the access_token. |
| 892 | |
| 893 | This method first checks by reading the Storage object if available. |
| 894 | If a refresh is still needed, it holds the Storage lock until the |
| 895 | refresh is completed. |
| 896 | |
| 897 | Args: |
| 898 | http_request: callable, a callable that matches the method signature of |
| 899 | httplib2.Http.request, used to make the refresh request. |
| 900 | |
| 901 | Raises: |
| 902 | AccessTokenRefreshError: When the refresh fails. |
| 903 | |
| 904 | </pre> |
| 905 | <dl class="fields"> |
| 906 | </dl> |
| 907 | </td></tr></table> |
| 908 | </div> |
| 909 | <a name="_do_refresh_request"></a> |
| 910 | <div class="private"> |
| 911 | <table class="details" border="1" cellpadding="3" |
| 912 | cellspacing="0" width="100%" bgcolor="white"> |
| 913 | <tr><td> |
| 914 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 915 | <tr valign="top"><td> |
| 916 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_do_refresh_request</span>(<span class="sig-arg">self</span>, |
| 917 | <span class="sig-arg">http_request</span>)</span> |
| 918 | </h3> |
| 919 | </td><td align="right" valign="top" |
| 920 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials._do_refresh_request">source code</a></span> |
| 921 | </td> |
| 922 | </tr></table> |
| 923 | |
| 924 | <pre class="literalblock"> |
| 925 | Refresh the access_token using the refresh_token. |
| 926 | |
| 927 | Args: |
| 928 | http_request: callable, a callable that matches the method signature of |
| 929 | httplib2.Http.request, used to make the refresh request. |
| 930 | |
| 931 | Raises: |
| 932 | AccessTokenRefreshError: When the refresh fails. |
| 933 | |
| 934 | </pre> |
| 935 | <dl class="fields"> |
| 936 | </dl> |
| 937 | </td></tr></table> |
| 938 | </div> |
Joe Gregorio | 41be8e8 | 2013-03-07 10:31:47 -0500 | [diff] [blame] | 939 | <a name="_revoke"></a> |
| 940 | <div class="private"> |
| 941 | <table class="details" border="1" cellpadding="3" |
| 942 | cellspacing="0" width="100%" bgcolor="white"> |
| 943 | <tr><td> |
| 944 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 945 | <tr valign="top"><td> |
| 946 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_revoke</span>(<span class="sig-arg">self</span>, |
| 947 | <span class="sig-arg">http_request</span>)</span> |
| 948 | </h3> |
| 949 | </td><td align="right" valign="top" |
| 950 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials._revoke">source code</a></span> |
| 951 | </td> |
| 952 | </tr></table> |
| 953 | |
| 954 | <pre class="literalblock"> |
| 955 | Revokes the refresh_token and deletes the store if available. |
| 956 | |
| 957 | Args: |
| 958 | http_request: callable, a callable that matches the method signature of |
| 959 | httplib2.Http.request, used to make the revoke request. |
| 960 | |
| 961 | </pre> |
| 962 | <dl class="fields"> |
| 963 | </dl> |
| 964 | </td></tr></table> |
| 965 | </div> |
| 966 | <a name="_do_revoke"></a> |
| 967 | <div class="private"> |
| 968 | <table class="details" border="1" cellpadding="3" |
| 969 | cellspacing="0" width="100%" bgcolor="white"> |
| 970 | <tr><td> |
| 971 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 972 | <tr valign="top"><td> |
| 973 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_do_revoke</span>(<span class="sig-arg">self</span>, |
| 974 | <span class="sig-arg">http_request</span>, |
| 975 | <span class="sig-arg">token</span>)</span> |
| 976 | </h3> |
| 977 | </td><td align="right" valign="top" |
| 978 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2Credentials._do_revoke">source code</a></span> |
| 979 | </td> |
| 980 | </tr></table> |
| 981 | |
| 982 | <pre class="literalblock"> |
| 983 | Revokes the credentials and deletes the store if available. |
| 984 | |
| 985 | Args: |
| 986 | http_request: callable, a callable that matches the method signature of |
| 987 | httplib2.Http.request, used to make the refresh request. |
| 988 | token: A string used as the token to be revoked. Can be either an |
| 989 | access_token or refresh_token. |
| 990 | |
| 991 | Raises: |
| 992 | TokenRevokeError: If the revoke request does not return with a 200 OK. |
| 993 | |
| 994 | </pre> |
| 995 | <dl class="fields"> |
| 996 | </dl> |
| 997 | </td></tr></table> |
| 998 | </div> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 999 | <br /> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 1000 | <!-- ==================== NAVIGATION BAR ==================== --> |
| 1001 | <table class="navbar" border="0" width="100%" cellpadding="0" |
| 1002 | bgcolor="#a0c0ff" cellspacing="0"> |
| 1003 | <tr valign="middle"> |
| 1004 | |
| 1005 | <!-- Tree link --> |
| 1006 | <th> <a |
| 1007 | href="module-tree.html">Trees</a> </th> |
| 1008 | |
| 1009 | <!-- Index link --> |
| 1010 | <th> <a |
| 1011 | href="identifier-index.html">Indices</a> </th> |
| 1012 | |
| 1013 | <!-- Help link --> |
| 1014 | <th> <a |
| 1015 | href="help.html">Help</a> </th> |
| 1016 | |
| 1017 | <th class="navbar" width="100%"></th> |
| 1018 | </tr> |
| 1019 | </table> |
| 1020 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
| 1021 | <tr> |
| 1022 | <td align="left" class="footer"> |
Joe Gregorio | 37802c3 | 2013-08-06 12:24:05 -0400 | [diff] [blame^] | 1023 | Generated by Epydoc 3.0.1 on Tue Aug 6 12:16:45 2013 |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 1024 | </td> |
| 1025 | <td align="right" class="footer"> |
| 1026 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
| 1027 | >http://epydoc.sourceforge.net</a> |
| 1028 | </td> |
| 1029 | </tr> |
| 1030 | </table> |
| 1031 | |
| 1032 | <script type="text/javascript"> |
| 1033 | <!-- |
| 1034 | // Private objects are initially displayed (because if |
| 1035 | // javascript is turned off then we want them to be |
| 1036 | // visible); but by default, we want to hide them. So hide |
| 1037 | // them unless we have a cookie that says to show them. |
| 1038 | checkCookie(); |
| 1039 | // --> |
| 1040 | </script> |
| 1041 | </body> |
| 1042 | </html> |