blob: eaac55f9d5e5aae4b5b0c943bcaa69c610907796 [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.appengine.AppAssertionCredentials</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.appengine-module.html">Module&nbsp;appengine</a> ::
39 Class&nbsp;AppAssertionCredentials
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.appengine.AppAssertionCredentials-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 AppAssertionCredentials</h1><p class="nomargin-top"><span class="codelink"><a href="oauth2client.appengine-pysrc.html#AppAssertionCredentials">source&nbsp;code</a></span></p>
57<center>
58<center> <map id="uml_class_diagram_for_oauth2cl" name="uml_class_diagram_for_oauth2cl">
59<area shape="rect" href="oauth2client.appengine.AppAssertionCredentials-class.html#__init__" title="Constructor for AppAssertionCredentials" alt="" coords="21,385,203,404"/>
60<area shape="rect" href="oauth2client.appengine.AppAssertionCredentials-class.html#from_json" title="Instantiate a Credentials object from a JSON description of it." alt="" coords="21,404,203,423"/>
61<area shape="rect" href="oauth2client.appengine.AppAssertionCredentials-class.html" title="Credentials object for App Engine Assertion Grants" alt="" coords="20,360,204,424"/>
62<area shape="rect" href="oauth2client.client.AssertionCredentials-class.html" title="Abstract Credentials object used for OAuth 2.0 assertion grants." alt="" coords="33,299,191,331"/>
63<area shape="rect" href="oauth2client.client.Credentials-class.html#NON_SERIALIZED_MEMBERS" title="oauth2client.client.Credentials.NON_SERIALIZED_MEMBERS" alt="" coords="17,28,207,47"/>
64<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="17,49,207,68"/>
65<area shape="rect" href="oauth2client.client.Credentials-class.html" title="Base class for all Credentials objects." alt="" coords="16,11,208,69"/>
66<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#access_token_expired" title="True if the credential is expired or invalid." alt="" coords="39,116,185,135"/>
67<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#authorize" title="Authorize an httplib2.Http instance with these credentials." alt="" coords="39,137,185,156"/>
68<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#refresh" title="Forces a refresh of the access_token." alt="" coords="39,156,185,175"/>
69<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#apply" title="Add the authorization to the headers." alt="" coords="39,175,185,193"/>
70<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#to_json" title="Creating a JSON representation of an instance of Credentials." alt="" coords="39,193,185,212"/>
71<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#set_store" title="Set the Storage for the credential." alt="" coords="39,212,185,231"/>
72<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#__getstate__" title="Trim the state down to something that can be pickled." alt="" coords="39,231,185,249"/>
73<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html#__setstate__" title="Reconstitute the state of the object from being pickled." alt="" coords="39,249,185,268"/>
74<area shape="rect" href="oauth2client.client.OAuth2Credentials-class.html" title="Credentials object for OAuth 2.0." alt="" coords="37,99,187,269"/>
75</map>
76 <img src="uml_class_diagram_for_oauth2cl.gif" alt='' usemap="#uml_class_diagram_for_oauth2cl" ismap="ismap" class="graph-without-title" />
77</center>
78</center>
79<hr />
80<pre class="literalblock">
81Credentials object for App Engine Assertion Grants
82
83This object will allow an App Engine application to identify itself to Google
84and other OAuth 2.0 servers that can verify assertions. It can be used for
85the purpose of accessing data stored under an account assigned to the App
86Engine application itself.
87
88This credential does not require a flow to instantiate because it represents
89a two legged flow, and therefore has all of the required information to
90generate and refresh its own access tokens.
91
92</pre>
93
94<!-- ==================== INSTANCE METHODS ==================== -->
95<a name="section-InstanceMethods"></a>
96<table class="summary" border="1" cellpadding="3"
97 cellspacing="0" width="100%" bgcolor="white">
98<tr bgcolor="#70b0f0" class="table-header">
99 <td colspan="2" class="table-header">
100 <table border="0" cellpadding="0" cellspacing="0" width="100%">
101 <tr valign="top">
102 <td align="left"><span class="table-header">Instance Methods</span></td>
103 <td align="right" valign="top"
104 ><span class="options">[<a href="#section-InstanceMethods"
105 class="privatelink" onclick="toggle_private();"
106 >hide private</a>]</span></td>
107 </tr>
108 </table>
109 </td>
110</tr>
111<tr>
112 <td width="15%" align="right" valign="top" class="summary">
113 <span class="summary-type">&nbsp;</span>
114 </td><td class="summary">
115 <table width="100%" cellpadding="0" cellspacing="0" border="0">
116 <tr>
117 <td><span class="summary-sig"><a href="oauth2client.appengine.AppAssertionCredentials-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
118 <span class="summary-sig-arg">scope</span>,
119 <span class="summary-sig-arg">**kwargs</span>)</span><br />
120 Constructor for AppAssertionCredentials</td>
121 <td align="right" valign="top">
122 <span class="codelink"><a href="oauth2client.appengine-pysrc.html#AppAssertionCredentials.__init__">source&nbsp;code</a></span>
123
124 </td>
125 </tr>
126 </table>
127
128 </td>
129 </tr>
130<tr class="private">
131 <td width="15%" align="right" valign="top" class="summary">
132 <span class="summary-type">&nbsp;</span>
133 </td><td class="summary">
134 <table width="100%" cellpadding="0" cellspacing="0" border="0">
135 <tr>
136 <td><span class="summary-sig"><a href="oauth2client.appengine.AppAssertionCredentials-class.html#_refresh" class="summary-sig-name" onclick="show_private();">_refresh</a>(<span class="summary-sig-arg">self</span>,
137 <span class="summary-sig-arg">http_request</span>)</span><br />
138 Refreshes the access_token.</td>
139 <td align="right" valign="top">
140 <span class="codelink"><a href="oauth2client.appengine-pysrc.html#AppAssertionCredentials._refresh">source&nbsp;code</a></span>
141
142 </td>
143 </tr>
144 </table>
145
146 </td>
147 </tr>
148 <tr>
149 <td colspan="2" class="summary">
150 <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.AssertionCredentials-class.html">client.AssertionCredentials</a></code></b> (private):
151 <code><a href="oauth2client.client.AssertionCredentials-class.html#_generate_assertion" onclick="show_private();">_generate_assertion</a></code>,
152 <code><a href="oauth2client.client.AssertionCredentials-class.html#_generate_refresh_request_body" onclick="show_private();">_generate_refresh_request_body</a></code>
153 </p></div>
154 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.OAuth2Credentials-class.html">client.OAuth2Credentials</a></code></b>:
155 <code><a href="oauth2client.client.OAuth2Credentials-class.html#__getstate__">__getstate__</a></code>,
156 <code><a href="oauth2client.client.OAuth2Credentials-class.html#__setstate__">__setstate__</a></code>,
157 <code><a href="oauth2client.client.OAuth2Credentials-class.html#apply">apply</a></code>,
158 <code><a href="oauth2client.client.OAuth2Credentials-class.html#authorize">authorize</a></code>,
159 <code><a href="oauth2client.client.OAuth2Credentials-class.html#refresh">refresh</a></code>,
160 <code><a href="oauth2client.client.OAuth2Credentials-class.html#set_store">set_store</a></code>,
161 <code><a href="oauth2client.client.OAuth2Credentials-class.html#to_json">to_json</a></code>
162 </p>
163 <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.OAuth2Credentials-class.html">client.OAuth2Credentials</a></code></b> (private):
164 <code><a href="oauth2client.client.OAuth2Credentials-class.html#_do_refresh_request" onclick="show_private();">_do_refresh_request</a></code>,
165 <code><a href="oauth2client.client.OAuth2Credentials-class.html#_generate_refresh_request_headers" onclick="show_private();">_generate_refresh_request_headers</a></code>,
166 <code><a href="oauth2client.client.OAuth2Credentials-class.html#_updateFromCredential" onclick="show_private();">_updateFromCredential</a></code>
167 </p></div>
168 <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.Credentials-class.html">client.Credentials</a></code></b> (private):
169 <code><a href="oauth2client.client.Credentials-class.html#_to_json" onclick="show_private();">_to_json</a></code>
170 </p></div>
171 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
172 <code>__delattr__</code>,
173 <code>__format__</code>,
174 <code>__getattribute__</code>,
175 <code>__hash__</code>,
176 <code>__new__</code>,
177 <code>__reduce__</code>,
178 <code>__reduce_ex__</code>,
179 <code>__repr__</code>,
180 <code>__setattr__</code>,
181 <code>__sizeof__</code>,
182 <code>__str__</code>,
183 <code>__subclasshook__</code>
184 </p>
185 </td>
186 </tr>
187</table>
188<!-- ==================== CLASS METHODS ==================== -->
189<a name="section-ClassMethods"></a>
190<table class="summary" border="1" cellpadding="3"
191 cellspacing="0" width="100%" bgcolor="white">
192<tr bgcolor="#70b0f0" class="table-header">
193 <td colspan="2" class="table-header">
194 <table border="0" cellpadding="0" cellspacing="0" width="100%">
195 <tr valign="top">
196 <td align="left"><span class="table-header">Class Methods</span></td>
197 <td align="right" valign="top"
198 ><span class="options">[<a href="#section-ClassMethods"
199 class="privatelink" onclick="toggle_private();"
200 >hide private</a>]</span></td>
201 </tr>
202 </table>
203 </td>
204</tr>
205<tr>
206 <td width="15%" align="right" valign="top" class="summary">
207 <span class="summary-type">&nbsp;</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.appengine.AppAssertionCredentials-class.html#from_json" class="summary-sig-name">from_json</a>(<span class="summary-sig-arg">cls</span>,
212 <span class="summary-sig-arg">json</span>)</span><br />
213 Instantiate a Credentials object from a JSON description of it.</td>
214 <td align="right" valign="top">
215 <span class="codelink"><a href="oauth2client.appengine-pysrc.html#AppAssertionCredentials.from_json">source&nbsp;code</a></span>
216
217 </td>
218 </tr>
219 </table>
220
221 </td>
222 </tr>
223 <tr>
224 <td colspan="2" class="summary">
225 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="oauth2client.client.Credentials-class.html">client.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">client.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">client.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">scope</span>,
311 <span class="sig-arg">**kwargs</span>)</span>
312 <br /><em class="fname">(Constructor)</em>
313 </h3>
314 </td><td align="right" valign="top"
315 ><span class="codelink"><a href="oauth2client.appengine-pysrc.html#AppAssertionCredentials.__init__">source&nbsp;code</a></span>&nbsp;
316 </td>
317 </tr></table>
318
319 <pre class="literalblock">
320Constructor for AppAssertionCredentials
321
322Args:
323 scope: string or list of strings, scope(s) of the credentials being requested.
324
325</pre>
326 <dl class="fields">
327 <dt>Overrides:
328 object.__init__
329 </dt>
330 </dl>
331</td></tr></table>
332</div>
333<a name="from_json"></a>
334<div>
335<table class="details" border="1" cellpadding="3"
336 cellspacing="0" width="100%" bgcolor="white">
337<tr><td>
338 <table width="100%" cellpadding="0" cellspacing="0" border="0">
339 <tr valign="top"><td>
340 <h3 class="epydoc"><span class="sig"><span class="sig-name">from_json</span>(<span class="sig-arg">cls</span>,
341 <span class="sig-arg">json</span>)</span>
342 <br /><em class="fname">Class Method</em>
343 </h3>
344 </td><td align="right" valign="top"
345 ><span class="codelink"><a href="oauth2client.appengine-pysrc.html#AppAssertionCredentials.from_json">source&nbsp;code</a></span>&nbsp;
346 </td>
347 </tr></table>
348
349 <pre class="literalblock">
350Instantiate a Credentials object from a JSON description of it. The JSON
351should have been produced by calling .to_json() on the object.
352
353Args:
354 data: dict, A deserialized JSON object.
355
356Returns:
357 An instance of a Credentials subclass.
358
359</pre>
360 <dl class="fields">
361 <dt>Overrides:
362 <a href="oauth2client.client.Credentials-class.html#from_json">client.Credentials.from_json</a>
363 <dd><em class="note">(inherited documentation)</em></dd>
364 </dt>
365 </dl>
366</td></tr></table>
367</div>
368<a name="_refresh"></a>
369<div class="private">
370<table class="details" border="1" cellpadding="3"
371 cellspacing="0" width="100%" bgcolor="white">
372<tr><td>
373 <table width="100%" cellpadding="0" cellspacing="0" border="0">
374 <tr valign="top"><td>
375 <h3 class="epydoc"><span class="sig"><span class="sig-name">_refresh</span>(<span class="sig-arg">self</span>,
376 <span class="sig-arg">http_request</span>)</span>
377 </h3>
378 </td><td align="right" valign="top"
379 ><span class="codelink"><a href="oauth2client.appengine-pysrc.html#AppAssertionCredentials._refresh">source&nbsp;code</a></span>&nbsp;
380 </td>
381 </tr></table>
382
383 <pre class="literalblock">
384Refreshes the access_token.
385
386Since the underlying App Engine app_identity implementation does its own
387caching we can skip all the storage hoops and just to a refresh using the
388API.
389
390Args:
391 http_request: callable, a callable that matches the method signature of
392 httplib2.Http.request, used to make the refresh request.
393
394Raises:
395 AccessTokenRefreshError: When the refresh fails.
396
397</pre>
398 <dl class="fields">
399 <dt>Overrides:
400 <a href="oauth2client.client.OAuth2Credentials-class.html#_refresh" onclick="show_private();">client.OAuth2Credentials._refresh</a>
401 </dt>
402 </dl>
403</td></tr></table>
404</div>
405<br />
406<!-- ==================== NAVIGATION BAR ==================== -->
407<table class="navbar" border="0" width="100%" cellpadding="0"
408 bgcolor="#a0c0ff" cellspacing="0">
409 <tr valign="middle">
410
411 <!-- Tree link -->
412 <th>&nbsp;&nbsp;&nbsp;<a
413 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
414
415 <!-- Index link -->
416 <th>&nbsp;&nbsp;&nbsp;<a
417 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
418
419 <!-- Help link -->
420 <th>&nbsp;&nbsp;&nbsp;<a
421 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
422
423 <th class="navbar" width="100%"></th>
424 </tr>
425</table>
426<table border="0" cellpadding="0" cellspacing="0" width="100%%">
427 <tr>
428 <td align="left" class="footer">
429 Generated by Epydoc 3.0.1 on Tue Jun 5 09:03:08 2012
430 </td>
431 <td align="right" class="footer">
432 <a target="mainFrame" href="http://epydoc.sourceforge.net"
433 >http://epydoc.sourceforge.net</a>
434 </td>
435 </tr>
436</table>
437
438<script type="text/javascript">
439 <!--
440 // Private objects are initially displayed (because if
441 // javascript is turned off then we want them to be
442 // visible); but by default, we want to hide them. So hide
443 // them unless we have a cookie that says to show them.
444 checkCookie();
445 // -->
446</script>
447</body>
448</html>