blob: 2b34623a399880460017d03144d75cc164421262 [file] [log] [blame]
Joe Gregorio5dc0f5c2012-06-05 13:34:31 -04001<?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.AssertionCredentials</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>&nbsp;&nbsp;&nbsp;<a
20 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
21
22 <!-- Index link -->
23 <th>&nbsp;&nbsp;&nbsp;<a
24 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
25
26 <!-- Help link -->
27 <th>&nbsp;&nbsp;&nbsp;<a
28 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</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&nbsp;oauth2client</a> ::
38 <a href="oauth2client.client-module.html">Module&nbsp;client</a> ::
39 Class&nbsp;AssertionCredentials
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&nbsp;private</a>]</span></td></tr>
47 <tr><td align="right"><span class="options"
48 >[<a href="frames.html" target="_top">frames</a
49 >]&nbsp;|&nbsp;<a href="oauth2client.client.AssertionCredentials-class.html"
50 target="_top">no&nbsp;frames</a>]</span></td></tr>
51 </table>
52 </td>
53 </tr>
54</table>
55<!-- ==================== CLASS DESCRIPTION ==================== -->
56<h1 class="epydoc">Class AssertionCredentials</h1><p class="nomargin-top"><span class="codelink"><a href="oauth2client.client-pysrc.html#AssertionCredentials">source&nbsp;code</a></span></p>
57<center>
58<center> <map id="uml_class_diagram_for_oauth2cl_13" name="uml_class_diagram_for_oauth2cl_13">
59<area shape="rect" href="oauth2client.client.AssertionCredentials-class.html#__init__" title="Constructor for AssertionFlowCredentials." alt="" coords="17,343,697,361"/>
60<area shape="rect" href="oauth2client.client.AssertionCredentials-class.html" title="Abstract Credentials object used for OAuth 2.0 assertion grants." alt="" coords="16,317,699,363"/>
61<area shape="rect" href="oauth2client.appengine.AppAssertionCredentials-class.html" title="Credentials object for App Engine Assertion Grants" alt="" coords="119,392,340,419"/>
62<area shape="rect" href="oauth2client.client.SignedJwtAssertionCredentials-class.html" title="Credentials object used for OAuth 2.0 Signed JWT assertion grants." alt="" coords="391,392,583,419"/>
63<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#access_token_expired" title="True if the credential is expired or invalid." alt="" coords="284,116,431,135"/>
64<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#authorize" title="Authorize an httplib2.Http instance with these credentials." alt="" coords="284,137,431,156"/>
65<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#refresh" title="Forces a refresh of the access_token." alt="" coords="284,156,431,175"/>
66<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#apply" title="Add the authorization to the headers." alt="" coords="284,175,431,193"/>
67<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#to_json" title="Creating a JSON representation of an instance of Credentials." alt="" coords="284,193,431,212"/>
68<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#from_json" title="Instantiate a Credentials object from a JSON description of it." alt="" coords="284,212,431,231"/>
69<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#set_store" title="Set the Storage for the credential." alt="" coords="284,231,431,249"/>
70<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#__getstate__" title="Trim the state down to something that can be pickled." alt="" coords="284,249,431,268"/>
71<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#__setstate__" title="Reconstitute the state of the object from being pickled." alt="" coords="284,268,431,287"/>
72<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html" title="Credentials object for OAuth 2.0." alt="" coords="283,99,432,288"/>
73<area shape="rect" href="oauth2client.client.Credentials-class.html#NON_SERIALIZED_MEMBERS" title="oauth2client.client.Credentials.NON_SERIALIZED_MEMBERS" alt="" coords="263,28,452,47"/>
74<area shape="rect" 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="263,49,452,68"/>
75<area shape="rect" href="oauth2client.client.Credentials-class.html" title="Base class for all Credentials objects." alt="" coords="261,11,453,69"/>
76</map>
77 <img src="uml_class_diagram_for_oauth2cl_13.gif" alt='' usemap="#uml_class_diagram_for_oauth2cl_13" ismap="ismap" class="graph-without-title" />
78</center>
79</center>
80<hr />
81<pre class="literalblock">
82Abstract Credentials object used for OAuth 2.0 assertion grants.
83
84This credential does not require a flow to instantiate because it
85represents a two legged flow, and therefore has all of the required
86information to generate and refresh its own access tokens. It must
87be subclassed to generate the appropriate assertion string.
88
89AssertionCredentials objects may be safely pickled and unpickled.
90
91</pre>
92
93<!-- ==================== INSTANCE METHODS ==================== -->
94<a name="section-InstanceMethods"></a>
95<table class="summary" border="1" cellpadding="3"
96 cellspacing="0" width="100%" bgcolor="white">
97<tr bgcolor="#70b0f0" class="table-header">
98 <td colspan="2" class="table-header">
99 <table border="0" cellpadding="0" cellspacing="0" width="100%">
100 <tr valign="top">
101 <td align="left"><span class="table-header">Instance Methods</span></td>
102 <td align="right" valign="top"
103 ><span class="options">[<a href="#section-InstanceMethods"
104 class="privatelink" onclick="toggle_private();"
105 >hide private</a>]</span></td>
106 </tr>
107 </table>
108 </td>
109</tr>
110<tr>
111 <td width="15%" align="right" valign="top" class="summary">
112 <span class="summary-type">&nbsp;</span>
113 </td><td class="summary">
114 <table width="100%" cellpadding="0" cellspacing="0" border="0">
115 <tr>
116 <td><span class="summary-sig"><a href="oauth2client.client.AssertionCredentials-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
117 <span class="summary-sig-arg">assertion_type</span>,
118 <span class="summary-sig-arg">user_agent</span>,
119 <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>,
120 <span class="summary-sig-arg">**unused_kwargs</span>)</span><br />
121 Constructor for AssertionFlowCredentials.</td>
122 <td align="right" valign="top">
123 <span class="codelink"><a href="oauth2client.client-pysrc.html#AssertionCredentials.__init__">source&nbsp;code</a></span>
124
125 </td>
126 </tr>
127 </table>
128
129 </td>
130 </tr>
131<tr class="private">
132 <td width="15%" align="right" valign="top" class="summary">
133 <span class="summary-type">&nbsp;</span>
134 </td><td class="summary">
135 <table width="100%" cellpadding="0" cellspacing="0" border="0">
136 <tr>
137 <td><span class="summary-sig"><a href="oauth2client.client.AssertionCredentials-class.html#_generate_refresh_request_body" class="summary-sig-name" onclick="show_private();">_generate_refresh_request_body</a>(<span class="summary-sig-arg">self</span>)</span><br />
138 Generate the body that will be used in the refresh request.</td>
139 <td align="right" valign="top">
140 <span class="codelink"><a href="oauth2client.client-pysrc.html#AssertionCredentials._generate_refresh_request_body">source&nbsp;code</a></span>
141
142 </td>
143 </tr>
144 </table>
145
146 </td>
147 </tr>
148<tr class="private">
149 <td width="15%" align="right" valign="top" class="summary">
150 <span class="summary-type">&nbsp;</span>
151 </td><td class="summary">
152 <table width="100%" cellpadding="0" cellspacing="0" border="0">
153 <tr>
154 <td><span class="summary-sig"><a name="_generate_assertion"></a><span class="summary-sig-name">_generate_assertion</span>(<span class="summary-sig-arg">self</span>)</span><br />
155 Generate the assertion string that will be used in the access token
156request.</td>
157 <td align="right" valign="top">
158 <span class="codelink"><a href="oauth2client.client-pysrc.html#AssertionCredentials._generate_assertion">source&nbsp;code</a></span>
159
160 </td>
161 </tr>
162 </table>
163
164 </td>
165 </tr>
166 <tr>
167 <td colspan="2" class="summary">
168 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.OAuth2Credentials-class.html">OAuth2Credentials</a></code></b>:
169 <code><a href="oauth2client.client.OAuth2Credentials-class.html#__getstate__">__getstate__</a></code>,
170 <code><a href="oauth2client.client.OAuth2Credentials-class.html#__setstate__">__setstate__</a></code>,
171 <code><a href="oauth2client.client.OAuth2Credentials-class.html#apply">apply</a></code>,
172 <code><a href="oauth2client.client.OAuth2Credentials-class.html#authorize">authorize</a></code>,
173 <code><a href="oauth2client.client.OAuth2Credentials-class.html#refresh">refresh</a></code>,
174 <code><a href="oauth2client.client.OAuth2Credentials-class.html#set_store">set_store</a></code>,
175 <code><a href="oauth2client.client.OAuth2Credentials-class.html#to_json">to_json</a></code>
176 </p>
177 <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.OAuth2Credentials-class.html">OAuth2Credentials</a></code></b> (private):
178 <code><a href="oauth2client.client.OAuth2Credentials-class.html#_do_refresh_request" onclick="show_private();">_do_refresh_request</a></code>,
179 <code><a href="oauth2client.client.OAuth2Credentials-class.html#_generate_refresh_request_headers" onclick="show_private();">_generate_refresh_request_headers</a></code>,
180 <code><a href="oauth2client.client.OAuth2Credentials-class.html#_refresh" onclick="show_private();">_refresh</a></code>,
181 <code><a href="oauth2client.client.OAuth2Credentials-class.html#_updateFromCredential" onclick="show_private();">_updateFromCredential</a></code>
182 </p></div>
183 <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.Credentials-class.html">Credentials</a></code></b> (private):
184 <code><a href="oauth2client.client.Credentials-class.html#_to_json" onclick="show_private();">_to_json</a></code>
185 </p></div>
186 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
187 <code>__delattr__</code>,
188 <code>__format__</code>,
189 <code>__getattribute__</code>,
190 <code>__hash__</code>,
191 <code>__new__</code>,
192 <code>__reduce__</code>,
193 <code>__reduce_ex__</code>,
194 <code>__repr__</code>,
195 <code>__setattr__</code>,
196 <code>__sizeof__</code>,
197 <code>__str__</code>,
198 <code>__subclasshook__</code>
199 </p>
200 </td>
201 </tr>
202</table>
203<!-- ==================== CLASS METHODS ==================== -->
204<a name="section-ClassMethods"></a>
205<table class="summary" border="1" cellpadding="3"
206 cellspacing="0" width="100%" bgcolor="white">
207<tr bgcolor="#70b0f0" class="table-header">
208 <td colspan="2" class="table-header">
209 <table border="0" cellpadding="0" cellspacing="0" width="100%">
210 <tr valign="top">
211 <td align="left"><span class="table-header">Class Methods</span></td>
212 <td align="right" valign="top"
213 ><span class="options">[<a href="#section-ClassMethods"
214 class="privatelink" onclick="toggle_private();"
215 >hide private</a>]</span></td>
216 </tr>
217 </table>
218 </td>
219</tr>
220 <tr>
221 <td colspan="2" class="summary">
222 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.OAuth2Credentials-class.html">OAuth2Credentials</a></code></b>:
223 <code><a href="oauth2client.client.OAuth2Credentials-class.html#from_json">from_json</a></code>
224 </p>
225 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.Credentials-class.html">Credentials</a></code></b>:
226 <code><a href="oauth2client.client.Credentials-class.html#new_from_json">new_from_json</a></code>
227 </p>
228 </td>
229 </tr>
230</table>
231<!-- ==================== CLASS VARIABLES ==================== -->
232<a name="section-ClassVariables"></a>
233<table class="summary" border="1" cellpadding="3"
234 cellspacing="0" width="100%" bgcolor="white">
235<tr bgcolor="#70b0f0" class="table-header">
236 <td colspan="2" class="table-header">
237 <table border="0" cellpadding="0" cellspacing="0" width="100%">
238 <tr valign="top">
239 <td align="left"><span class="table-header">Class Variables</span></td>
240 <td align="right" valign="top"
241 ><span class="options">[<a href="#section-ClassVariables"
242 class="privatelink" onclick="toggle_private();"
243 >hide private</a>]</span></td>
244 </tr>
245 </table>
246 </td>
247</tr>
248 <tr>
249 <td colspan="2" class="summary">
250 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.Credentials-class.html">Credentials</a></code></b>:
251 <code><a href="oauth2client.client.Credentials-class.html#NON_SERIALIZED_MEMBERS">NON_SERIALIZED_MEMBERS</a></code>
252 </p>
253 </td>
254 </tr>
255</table>
256<!-- ==================== PROPERTIES ==================== -->
257<a name="section-Properties"></a>
258<table class="summary" border="1" cellpadding="3"
259 cellspacing="0" width="100%" bgcolor="white">
260<tr bgcolor="#70b0f0" class="table-header">
261 <td colspan="2" class="table-header">
262 <table border="0" cellpadding="0" cellspacing="0" width="100%">
263 <tr valign="top">
264 <td align="left"><span class="table-header">Properties</span></td>
265 <td align="right" valign="top"
266 ><span class="options">[<a href="#section-Properties"
267 class="privatelink" onclick="toggle_private();"
268 >hide private</a>]</span></td>
269 </tr>
270 </table>
271 </td>
272</tr>
273 <tr>
274 <td colspan="2" class="summary">
275 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.OAuth2Credentials-class.html">OAuth2Credentials</a></code></b>:
276 <code><a href="oauth2client.client.OAuth2Credentials-class.html#access_token_expired">access_token_expired</a></code>
277 </p>
278 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
279 <code>__class__</code>
280 </p>
281 </td>
282 </tr>
283</table>
284<!-- ==================== METHOD DETAILS ==================== -->
285<a name="section-MethodDetails"></a>
286<table class="details" border="1" cellpadding="3"
287 cellspacing="0" width="100%" bgcolor="white">
288<tr bgcolor="#70b0f0" class="table-header">
289 <td colspan="2" class="table-header">
290 <table border="0" cellpadding="0" cellspacing="0" width="100%">
291 <tr valign="top">
292 <td align="left"><span class="table-header">Method Details</span></td>
293 <td align="right" valign="top"
294 ><span class="options">[<a href="#section-MethodDetails"
295 class="privatelink" onclick="toggle_private();"
296 >hide private</a>]</span></td>
297 </tr>
298 </table>
299 </td>
300</tr>
301</table>
302<a name="__init__"></a>
303<div>
304<table class="details" border="1" cellpadding="3"
305 cellspacing="0" width="100%" bgcolor="white">
306<tr><td>
307 <table width="100%" cellpadding="0" cellspacing="0" border="0">
308 <tr valign="top"><td>
309 <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
310 <span class="sig-arg">assertion_type</span>,
311 <span class="sig-arg">user_agent</span>,
312 <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>,
313 <span class="sig-arg">**unused_kwargs</span>)</span>
314 <br /><em class="fname">(Constructor)</em>
315 </h3>
316 </td><td align="right" valign="top"
317 ><span class="codelink"><a href="oauth2client.client-pysrc.html#AssertionCredentials.__init__">source&nbsp;code</a></span>&nbsp;
318 </td>
319 </tr></table>
320
321 <pre class="literalblock">
322Constructor for AssertionFlowCredentials.
323
324Args:
325 assertion_type: string, assertion type that will be declared to the auth
326 server
327 user_agent: string, The HTTP User-Agent to provide for this application.
328 token_uri: string, URI for token endpoint. For convenience
329 defaults to Google's endpoints but any OAuth 2.0 provider can be used.
330
331</pre>
332 <dl class="fields">
333 <dt>Overrides:
334 object.__init__
335 </dt>
336 </dl>
337</td></tr></table>
338</div>
339<a name="_generate_refresh_request_body"></a>
340<div class="private">
341<table class="details" border="1" cellpadding="3"
342 cellspacing="0" width="100%" bgcolor="white">
343<tr><td>
344 <table width="100%" cellpadding="0" cellspacing="0" border="0">
345 <tr valign="top"><td>
346 <h3 class="epydoc"><span class="sig"><span class="sig-name">_generate_refresh_request_body</span>(<span class="sig-arg">self</span>)</span>
347 </h3>
348 </td><td align="right" valign="top"
349 ><span class="codelink"><a href="oauth2client.client-pysrc.html#AssertionCredentials._generate_refresh_request_body">source&nbsp;code</a></span>&nbsp;
350 </td>
351 </tr></table>
352
353 <pre class="literalblock">
354Generate the body that will be used in the refresh request.
355
356</pre>
357 <dl class="fields">
358 <dt>Overrides:
359 <a href="oauth2client.client.OAuth2Credentials-class.html#_generate_refresh_request_body" onclick="show_private();">OAuth2Credentials._generate_refresh_request_body</a>
360 <dd><em class="note">(inherited documentation)</em></dd>
361 </dt>
362 </dl>
363</td></tr></table>
364</div>
365<br />
366<!-- ==================== NAVIGATION BAR ==================== -->
367<table class="navbar" border="0" width="100%" cellpadding="0"
368 bgcolor="#a0c0ff" cellspacing="0">
369 <tr valign="middle">
370
371 <!-- Tree link -->
372 <th>&nbsp;&nbsp;&nbsp;<a
373 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
374
375 <!-- Index link -->
376 <th>&nbsp;&nbsp;&nbsp;<a
377 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
378
379 <!-- Help link -->
380 <th>&nbsp;&nbsp;&nbsp;<a
381 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
382
383 <th class="navbar" width="100%"></th>
384 </tr>
385</table>
386<table border="0" cellpadding="0" cellspacing="0" width="100%%">
387 <tr>
388 <td align="left" class="footer">
389 Generated by Epydoc 3.0.1 on Tue Jun 5 09:03:09 2012
390 </td>
391 <td align="right" class="footer">
392 <a target="mainFrame" href="http://epydoc.sourceforge.net"
393 >http://epydoc.sourceforge.net</a>
394 </td>
395 </tr>
396</table>
397
398<script type="text/javascript">
399 <!--
400 // Private objects are initially displayed (because if
401 // javascript is turned off then we want them to be
402 // visible); but by default, we want to hide them. So hide
403 // them unless we have a cookie that says to show them.
404 checkCookie();
405 // -->
406</script>
407</body>
408</html>