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.OAuth2WebServerFlow</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 OAuth2WebServerFlow |
| 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.OAuth2WebServerFlow-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 OAuth2WebServerFlow</h1><p class="nomargin-top"><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2WebServerFlow">source code</a></span></p> |
| 57 | <center> |
Joe Gregorio | 746096f | 2012-06-15 10:53:36 -0400 | [diff] [blame] | 58 | <center> <map id="class_hierarchy_for_oauth2webs" name="class_hierarchy_for_oauth2webs"> |
| 59 | <area shape="rect" href="oauth2client.client.Flow-class.html" title="Flow" alt="" coords="59,5,107,32"/> |
| 60 | <area shape="rect" href="oauth2client.client.OAuth2WebServerFlow-class.html" title="OAuth2WebServerFlow" alt="" coords="5,61,160,88"/> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 61 | </map> |
Joe Gregorio | 746096f | 2012-06-15 10:53:36 -0400 | [diff] [blame] | 62 | <img src="class_hierarchy_for_oauth2webs.gif" alt='' usemap="#class_hierarchy_for_oauth2webs" ismap="ismap" class="graph-without-title" /> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 63 | </center> |
| 64 | </center> |
| 65 | <hr /> |
| 66 | <pre class="literalblock"> |
| 67 | Does the Web Server Flow for OAuth 2.0. |
| 68 | |
| 69 | OAuth2Credentials objects may be safely pickled and unpickled. |
| 70 | |
| 71 | </pre> |
| 72 | |
| 73 | <!-- ==================== INSTANCE METHODS ==================== --> |
| 74 | <a name="section-InstanceMethods"></a> |
| 75 | <table class="summary" border="1" cellpadding="3" |
| 76 | cellspacing="0" width="100%" bgcolor="white"> |
| 77 | <tr bgcolor="#70b0f0" class="table-header"> |
| 78 | <td colspan="2" class="table-header"> |
| 79 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 80 | <tr valign="top"> |
| 81 | <td align="left"><span class="table-header">Instance Methods</span></td> |
| 82 | <td align="right" valign="top" |
| 83 | ><span class="options">[<a href="#section-InstanceMethods" |
| 84 | class="privatelink" onclick="toggle_private();" |
| 85 | >hide private</a>]</span></td> |
| 86 | </tr> |
| 87 | </table> |
| 88 | </td> |
| 89 | </tr> |
| 90 | <tr> |
| 91 | <td width="15%" align="right" valign="top" class="summary"> |
| 92 | <span class="summary-type"> </span> |
| 93 | </td><td class="summary"> |
| 94 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 95 | <tr> |
| 96 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2WebServerFlow-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, |
| 97 | <span class="summary-sig-arg">client_id</span>, |
| 98 | <span class="summary-sig-arg">client_secret</span>, |
| 99 | <span class="summary-sig-arg">scope</span>, |
| 100 | <span class="summary-sig-arg">user_agent</span>=<span class="summary-sig-default">None</span>, |
| 101 | <span class="summary-sig-arg">auth_uri</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">https://accounts.google.com/o/oauth2/auth</code><code class="variable-quote">'</code></span>, |
| 102 | <span class="summary-sig-arg">token_uri</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">https://accounts.google.com/o/oauth2/token</code><code class="variable-quote">'</code></span>, |
| 103 | <span class="summary-sig-arg">**kwargs</span>)</span><br /> |
| 104 | Constructor for OAuth2WebServerFlow.</td> |
| 105 | <td align="right" valign="top"> |
| 106 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2WebServerFlow.__init__">source code</a></span> |
| 107 | |
| 108 | </td> |
| 109 | </tr> |
| 110 | </table> |
| 111 | |
| 112 | </td> |
| 113 | </tr> |
| 114 | <tr> |
| 115 | <td width="15%" align="right" valign="top" class="summary"> |
| 116 | <span class="summary-type"> </span> |
| 117 | </td><td class="summary"> |
| 118 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 119 | <tr> |
| 120 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2WebServerFlow-class.html#step1_get_authorize_url" class="summary-sig-name">step1_get_authorize_url</a>(<span class="summary-sig-arg">self</span>, |
| 121 | <span class="summary-sig-arg">redirect_uri</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">urn:ietf:wg:oauth:2.0:oob</code><code class="variable-quote">'</code></span>)</span><br /> |
| 122 | Returns a URI to redirect to the provider.</td> |
| 123 | <td align="right" valign="top"> |
| 124 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2WebServerFlow.step1_get_authorize_url">source code</a></span> |
| 125 | |
| 126 | </td> |
| 127 | </tr> |
| 128 | </table> |
| 129 | |
| 130 | </td> |
| 131 | </tr> |
| 132 | <tr> |
| 133 | <td width="15%" align="right" valign="top" class="summary"> |
| 134 | <span class="summary-type"> </span> |
| 135 | </td><td class="summary"> |
| 136 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 137 | <tr> |
| 138 | <td><span class="summary-sig"><a href="oauth2client.client.OAuth2WebServerFlow-class.html#step2_exchange" class="summary-sig-name">step2_exchange</a>(<span class="summary-sig-arg">self</span>, |
| 139 | <span class="summary-sig-arg">code</span>, |
| 140 | <span class="summary-sig-arg">http</span>=<span class="summary-sig-default">None</span>)</span><br /> |
| 141 | Exhanges a code for OAuth2Credentials.</td> |
| 142 | <td align="right" valign="top"> |
| 143 | <span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2WebServerFlow.step2_exchange">source code</a></span> |
| 144 | |
| 145 | </td> |
| 146 | </tr> |
| 147 | </table> |
| 148 | |
| 149 | </td> |
| 150 | </tr> |
| 151 | <tr> |
| 152 | <td colspan="2" class="summary"> |
| 153 | <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
| 154 | <code>__delattr__</code>, |
| 155 | <code>__format__</code>, |
| 156 | <code>__getattribute__</code>, |
| 157 | <code>__hash__</code>, |
| 158 | <code>__new__</code>, |
| 159 | <code>__reduce__</code>, |
| 160 | <code>__reduce_ex__</code>, |
| 161 | <code>__repr__</code>, |
| 162 | <code>__setattr__</code>, |
| 163 | <code>__sizeof__</code>, |
| 164 | <code>__str__</code>, |
| 165 | <code>__subclasshook__</code> |
| 166 | </p> |
| 167 | </td> |
| 168 | </tr> |
| 169 | </table> |
| 170 | <!-- ==================== PROPERTIES ==================== --> |
| 171 | <a name="section-Properties"></a> |
| 172 | <table class="summary" border="1" cellpadding="3" |
| 173 | cellspacing="0" width="100%" bgcolor="white"> |
| 174 | <tr bgcolor="#70b0f0" class="table-header"> |
| 175 | <td colspan="2" class="table-header"> |
| 176 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 177 | <tr valign="top"> |
| 178 | <td align="left"><span class="table-header">Properties</span></td> |
| 179 | <td align="right" valign="top" |
| 180 | ><span class="options">[<a href="#section-Properties" |
| 181 | class="privatelink" onclick="toggle_private();" |
| 182 | >hide private</a>]</span></td> |
| 183 | </tr> |
| 184 | </table> |
| 185 | </td> |
| 186 | </tr> |
| 187 | <tr> |
| 188 | <td colspan="2" class="summary"> |
| 189 | <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
| 190 | <code>__class__</code> |
| 191 | </p> |
| 192 | </td> |
| 193 | </tr> |
| 194 | </table> |
| 195 | <!-- ==================== METHOD DETAILS ==================== --> |
| 196 | <a name="section-MethodDetails"></a> |
| 197 | <table class="details" border="1" cellpadding="3" |
| 198 | cellspacing="0" width="100%" bgcolor="white"> |
| 199 | <tr bgcolor="#70b0f0" class="table-header"> |
| 200 | <td colspan="2" class="table-header"> |
| 201 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 202 | <tr valign="top"> |
| 203 | <td align="left"><span class="table-header">Method Details</span></td> |
| 204 | <td align="right" valign="top" |
| 205 | ><span class="options">[<a href="#section-MethodDetails" |
| 206 | class="privatelink" onclick="toggle_private();" |
| 207 | >hide private</a>]</span></td> |
| 208 | </tr> |
| 209 | </table> |
| 210 | </td> |
| 211 | </tr> |
| 212 | </table> |
| 213 | <a name="__init__"></a> |
| 214 | <div> |
| 215 | <table class="details" border="1" cellpadding="3" |
| 216 | cellspacing="0" width="100%" bgcolor="white"> |
| 217 | <tr><td> |
| 218 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 219 | <tr valign="top"><td> |
| 220 | <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, |
| 221 | <span class="sig-arg">client_id</span>, |
| 222 | <span class="sig-arg">client_secret</span>, |
| 223 | <span class="sig-arg">scope</span>, |
| 224 | <span class="sig-arg">user_agent</span>=<span class="sig-default">None</span>, |
| 225 | <span class="sig-arg">auth_uri</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">https://accounts.google.com/o/oauth2/auth</code><code class="variable-quote">'</code></span>, |
| 226 | <span class="sig-arg">token_uri</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">https://accounts.google.com/o/oauth2/token</code><code class="variable-quote">'</code></span>, |
| 227 | <span class="sig-arg">**kwargs</span>)</span> |
| 228 | <br /><em class="fname">(Constructor)</em> |
| 229 | </h3> |
| 230 | </td><td align="right" valign="top" |
| 231 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2WebServerFlow.__init__">source code</a></span> |
| 232 | </td> |
| 233 | </tr></table> |
| 234 | |
| 235 | <pre class="literalblock"> |
| 236 | Constructor for OAuth2WebServerFlow. |
| 237 | |
| 238 | Args: |
| 239 | client_id: string, client identifier. |
| 240 | client_secret: string client secret. |
| 241 | scope: string or list of strings, scope(s) of the credentials being |
| 242 | requested. |
| 243 | user_agent: string, HTTP User-Agent to provide for this application. |
| 244 | auth_uri: string, URI for authorization endpoint. For convenience |
| 245 | defaults to Google's endpoints but any OAuth 2.0 provider can be used. |
| 246 | token_uri: string, URI for token endpoint. For convenience |
| 247 | defaults to Google's endpoints but any OAuth 2.0 provider can be used. |
| 248 | **kwargs: dict, The keyword arguments are all optional and required |
| 249 | parameters for the OAuth calls. |
| 250 | |
| 251 | </pre> |
| 252 | <dl class="fields"> |
| 253 | <dt>Overrides: |
| 254 | object.__init__ |
| 255 | </dt> |
| 256 | </dl> |
| 257 | </td></tr></table> |
| 258 | </div> |
| 259 | <a name="step1_get_authorize_url"></a> |
| 260 | <div> |
| 261 | <table class="details" border="1" cellpadding="3" |
| 262 | cellspacing="0" width="100%" bgcolor="white"> |
| 263 | <tr><td> |
| 264 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 265 | <tr valign="top"><td> |
| 266 | <h3 class="epydoc"><span class="sig"><span class="sig-name">step1_get_authorize_url</span>(<span class="sig-arg">self</span>, |
| 267 | <span class="sig-arg">redirect_uri</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">urn:ietf:wg:oauth:2.0:oob</code><code class="variable-quote">'</code></span>)</span> |
| 268 | </h3> |
| 269 | </td><td align="right" valign="top" |
| 270 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2WebServerFlow.step1_get_authorize_url">source code</a></span> |
| 271 | </td> |
| 272 | </tr></table> |
| 273 | |
| 274 | <pre class="literalblock"> |
| 275 | Returns a URI to redirect to the provider. |
| 276 | |
| 277 | Args: |
| 278 | redirect_uri: string, Either the string 'urn:ietf:wg:oauth:2.0:oob' for |
| 279 | a non-web-based application, or a URI that handles the callback from |
| 280 | the authorization server. |
| 281 | |
| 282 | If redirect_uri is 'urn:ietf:wg:oauth:2.0:oob' then pass in the |
| 283 | generated verification code to step2_exchange, |
| 284 | otherwise pass in the query parameters received |
| 285 | at the callback uri to step2_exchange. |
| 286 | |
| 287 | </pre> |
| 288 | <dl class="fields"> |
| 289 | </dl> |
| 290 | </td></tr></table> |
| 291 | </div> |
| 292 | <a name="step2_exchange"></a> |
| 293 | <div> |
| 294 | <table class="details" border="1" cellpadding="3" |
| 295 | cellspacing="0" width="100%" bgcolor="white"> |
| 296 | <tr><td> |
| 297 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 298 | <tr valign="top"><td> |
| 299 | <h3 class="epydoc"><span class="sig"><span class="sig-name">step2_exchange</span>(<span class="sig-arg">self</span>, |
| 300 | <span class="sig-arg">code</span>, |
| 301 | <span class="sig-arg">http</span>=<span class="sig-default">None</span>)</span> |
| 302 | </h3> |
| 303 | </td><td align="right" valign="top" |
| 304 | ><span class="codelink"><a href="oauth2client.client-pysrc.html#OAuth2WebServerFlow.step2_exchange">source code</a></span> |
| 305 | </td> |
| 306 | </tr></table> |
| 307 | |
| 308 | <pre class="literalblock"> |
| 309 | Exhanges a code for OAuth2Credentials. |
| 310 | |
| 311 | Args: |
| 312 | code: string or dict, either the code as a string, or a dictionary |
| 313 | of the query parameters to the redirect_uri, which contains |
| 314 | the code. |
| 315 | http: httplib2.Http, optional http instance to use to do the fetch |
| 316 | |
Joe Gregorio | 746096f | 2012-06-15 10:53:36 -0400 | [diff] [blame] | 317 | Returns: |
| 318 | An OAuth2Credentials object that can be used to authorize requests. |
| 319 | |
| 320 | Raises: |
| 321 | FlowExchangeError if a problem occured exchanging the code for a |
| 322 | refresh_token. |
| 323 | |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 324 | </pre> |
| 325 | <dl class="fields"> |
| 326 | </dl> |
| 327 | </td></tr></table> |
| 328 | </div> |
| 329 | <br /> |
| 330 | <!-- ==================== NAVIGATION BAR ==================== --> |
| 331 | <table class="navbar" border="0" width="100%" cellpadding="0" |
| 332 | bgcolor="#a0c0ff" cellspacing="0"> |
| 333 | <tr valign="middle"> |
| 334 | |
| 335 | <!-- Tree link --> |
| 336 | <th> <a |
| 337 | href="module-tree.html">Trees</a> </th> |
| 338 | |
| 339 | <!-- Index link --> |
| 340 | <th> <a |
| 341 | href="identifier-index.html">Indices</a> </th> |
| 342 | |
| 343 | <!-- Help link --> |
| 344 | <th> <a |
| 345 | href="help.html">Help</a> </th> |
| 346 | |
| 347 | <th class="navbar" width="100%"></th> |
| 348 | </tr> |
| 349 | </table> |
| 350 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
| 351 | <tr> |
| 352 | <td align="left" class="footer"> |
Joe Gregorio | 672051e | 2012-07-10 09:11:45 -0400 | [diff] [blame] | 353 | Generated by Epydoc 3.0.1 on Tue Jul 10 07:59:21 2012 |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 354 | </td> |
| 355 | <td align="right" class="footer"> |
| 356 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
| 357 | >http://epydoc.sourceforge.net</a> |
| 358 | </td> |
| 359 | </tr> |
| 360 | </table> |
| 361 | |
| 362 | <script type="text/javascript"> |
| 363 | <!-- |
| 364 | // Private objects are initially displayed (because if |
| 365 | // javascript is turned off then we want them to be |
| 366 | // visible); but by default, we want to hide them. So hide |
| 367 | // them unless we have a cookie that says to show them. |
| 368 | checkCookie(); |
| 369 | // --> |
| 370 | </script> |
| 371 | </body> |
| 372 | </html> |