• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>googleapiclient._auth</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  <!-- Home link -->
18      <th>&nbsp;&nbsp;&nbsp;<a
19        href="googleapiclient-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21  <!-- Tree link -->
22      <th>&nbsp;&nbsp;&nbsp;<a
23        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25  <!-- Index link -->
26      <th>&nbsp;&nbsp;&nbsp;<a
27        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29  <!-- Help link -->
30      <th>&nbsp;&nbsp;&nbsp;<a
31        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33      <th class="navbar" width="100%"></th>
34  </tr>
35</table>
36<table width="100%" cellpadding="0" cellspacing="0">
37  <tr valign="top">
38    <td width="100%">
39      <span class="breadcrumbs">
40        <a href="googleapiclient-module.html">Package&nbsp;googleapiclient</a> ::
41        Module&nbsp;_auth
42      </span>
43    </td>
44    <td>
45      <table cellpadding="0" cellspacing="0">
46        <!-- hide/show private -->
47        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
48    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
49        <tr><td align="right"><span class="options"
50            >[<a href="frames.html" target="_top">frames</a
51            >]&nbsp;|&nbsp;<a href="googleapiclient._auth-module.html"
52            target="_top">no&nbsp;frames</a>]</span></td></tr>
53      </table>
54    </td>
55  </tr>
56</table>
57<!-- ==================== MODULE DESCRIPTION ==================== -->
58<h1 class="epydoc">Module _auth</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient._auth-pysrc.html">source&nbsp;code</a></span></p>
59<pre class="literalblock">
60Helpers for authentication using oauth2client or google-auth.
61
62</pre>
63
64<!-- ==================== FUNCTIONS ==================== -->
65<a name="section-Functions"></a>
66<table class="summary" border="1" cellpadding="3"
67       cellspacing="0" width="100%" bgcolor="white">
68<tr bgcolor="#70b0f0" class="table-header">
69  <td colspan="2" class="table-header">
70    <table border="0" cellpadding="0" cellspacing="0" width="100%">
71      <tr valign="top">
72        <td align="left"><span class="table-header">Functions</span></td>
73        <td align="right" valign="top"
74         ><span class="options">[<a href="#section-Functions"
75         class="privatelink" onclick="toggle_private();"
76         >hide private</a>]</span></td>
77      </tr>
78    </table>
79  </td>
80</tr>
81<tr>
82    <td width="15%" align="right" valign="top" class="summary">
83      <span class="summary-type">&nbsp;</span>
84    </td><td class="summary">
85      <table width="100%" cellpadding="0" cellspacing="0" border="0">
86        <tr>
87          <td><span class="summary-sig"><a name="default_credentials"></a><span class="summary-sig-name">default_credentials</span>()</span><br />
88      Returns Application Default Credentials.</td>
89          <td align="right" valign="top">
90            <span class="codelink"><a href="googleapiclient._auth-pysrc.html#default_credentials">source&nbsp;code</a></span>
91
92          </td>
93        </tr>
94      </table>
95
96    </td>
97  </tr>
98<tr>
99    <td width="15%" align="right" valign="top" class="summary">
100      <span class="summary-type">&nbsp;</span>
101    </td><td class="summary">
102      <table width="100%" cellpadding="0" cellspacing="0" border="0">
103        <tr>
104          <td><span class="summary-sig"><a href="googleapiclient._auth-module.html#with_scopes" class="summary-sig-name">with_scopes</a>(<span class="summary-sig-arg">credentials</span>,
105        <span class="summary-sig-arg">scopes</span>)</span><br />
106      Scopes the credentials if necessary.</td>
107          <td align="right" valign="top">
108            <span class="codelink"><a href="googleapiclient._auth-pysrc.html#with_scopes">source&nbsp;code</a></span>
109
110          </td>
111        </tr>
112      </table>
113
114    </td>
115  </tr>
116<tr>
117    <td width="15%" align="right" valign="top" class="summary">
118      <span class="summary-type">&nbsp;</span>
119    </td><td class="summary">
120      <table width="100%" cellpadding="0" cellspacing="0" border="0">
121        <tr>
122          <td><span class="summary-sig"><a href="googleapiclient._auth-module.html#authorized_http" class="summary-sig-name">authorized_http</a>(<span class="summary-sig-arg">credentials</span>)</span><br />
123      Returns an http client that is authorized with the given credentials.</td>
124          <td align="right" valign="top">
125            <span class="codelink"><a href="googleapiclient._auth-pysrc.html#authorized_http">source&nbsp;code</a></span>
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">&nbsp;</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 name="refresh_credentials"></a><span class="summary-sig-name">refresh_credentials</span>(<span class="summary-sig-arg">credentials</span>)</span></td>
140          <td align="right" valign="top">
141            <span class="codelink"><a href="googleapiclient._auth-pysrc.html#refresh_credentials">source&nbsp;code</a></span>
142
143          </td>
144        </tr>
145      </table>
146
147    </td>
148  </tr>
149<tr>
150    <td width="15%" align="right" valign="top" class="summary">
151      <span class="summary-type">&nbsp;</span>
152    </td><td class="summary">
153      <table width="100%" cellpadding="0" cellspacing="0" border="0">
154        <tr>
155          <td><span class="summary-sig"><a name="apply_credentials"></a><span class="summary-sig-name">apply_credentials</span>(<span class="summary-sig-arg">credentials</span>,
156        <span class="summary-sig-arg">headers</span>)</span></td>
157          <td align="right" valign="top">
158            <span class="codelink"><a href="googleapiclient._auth-pysrc.html#apply_credentials">source&nbsp;code</a></span>
159
160          </td>
161        </tr>
162      </table>
163
164    </td>
165  </tr>
166<tr>
167    <td width="15%" align="right" valign="top" class="summary">
168      <span class="summary-type">&nbsp;</span>
169    </td><td class="summary">
170      <table width="100%" cellpadding="0" cellspacing="0" border="0">
171        <tr>
172          <td><span class="summary-sig"><a name="is_valid"></a><span class="summary-sig-name">is_valid</span>(<span class="summary-sig-arg">credentials</span>)</span></td>
173          <td align="right" valign="top">
174            <span class="codelink"><a href="googleapiclient._auth-pysrc.html#is_valid">source&nbsp;code</a></span>
175
176          </td>
177        </tr>
178      </table>
179
180    </td>
181  </tr>
182<tr>
183    <td width="15%" align="right" valign="top" class="summary">
184      <span class="summary-type">&nbsp;</span>
185    </td><td class="summary">
186      <table width="100%" cellpadding="0" cellspacing="0" border="0">
187        <tr>
188          <td><span class="summary-sig"><a name="get_credentials_from_http"></a><span class="summary-sig-name">get_credentials_from_http</span>(<span class="summary-sig-arg">http</span>)</span></td>
189          <td align="right" valign="top">
190            <span class="codelink"><a href="googleapiclient._auth-pysrc.html#get_credentials_from_http">source&nbsp;code</a></span>
191
192          </td>
193        </tr>
194      </table>
195
196    </td>
197  </tr>
198</table>
199<!-- ==================== VARIABLES ==================== -->
200<a name="section-Variables"></a>
201<table class="summary" border="1" cellpadding="3"
202       cellspacing="0" width="100%" bgcolor="white">
203<tr bgcolor="#70b0f0" class="table-header">
204  <td colspan="2" class="table-header">
205    <table border="0" cellpadding="0" cellspacing="0" width="100%">
206      <tr valign="top">
207        <td align="left"><span class="table-header">Variables</span></td>
208        <td align="right" valign="top"
209         ><span class="options">[<a href="#section-Variables"
210         class="privatelink" onclick="toggle_private();"
211         >hide private</a>]</span></td>
212      </tr>
213    </table>
214  </td>
215</tr>
216<tr>
217    <td width="15%" align="right" valign="top" class="summary">
218      <span class="summary-type">&nbsp;</span>
219    </td><td class="summary">
220        <a name="HAS_GOOGLE_AUTH"></a><span class="summary-name">HAS_GOOGLE_AUTH</span> = <code title="False">False</code>
221    </td>
222  </tr>
223<tr>
224    <td width="15%" align="right" valign="top" class="summary">
225      <span class="summary-type">&nbsp;</span>
226    </td><td class="summary">
227        <a name="google_auth_httplib2"></a><span class="summary-name">google_auth_httplib2</span> = <code title="None">None</code>
228    </td>
229  </tr>
230<tr>
231    <td width="15%" align="right" valign="top" class="summary">
232      <span class="summary-type">&nbsp;</span>
233    </td><td class="summary">
234        <a name="HAS_OAUTH2CLIENT"></a><span class="summary-name">HAS_OAUTH2CLIENT</span> = <code title="False">False</code>
235    </td>
236  </tr>
237</table>
238<!-- ==================== FUNCTION DETAILS ==================== -->
239<a name="section-FunctionDetails"></a>
240<table class="details" border="1" cellpadding="3"
241       cellspacing="0" width="100%" bgcolor="white">
242<tr bgcolor="#70b0f0" class="table-header">
243  <td colspan="2" class="table-header">
244    <table border="0" cellpadding="0" cellspacing="0" width="100%">
245      <tr valign="top">
246        <td align="left"><span class="table-header">Function Details</span></td>
247        <td align="right" valign="top"
248         ><span class="options">[<a href="#section-FunctionDetails"
249         class="privatelink" onclick="toggle_private();"
250         >hide private</a>]</span></td>
251      </tr>
252    </table>
253  </td>
254</tr>
255</table>
256<a name="with_scopes"></a>
257<div>
258<table class="details" border="1" cellpadding="3"
259       cellspacing="0" width="100%" bgcolor="white">
260<tr><td>
261  <table width="100%" cellpadding="0" cellspacing="0" border="0">
262  <tr valign="top"><td>
263  <h3 class="epydoc"><span class="sig"><span class="sig-name">with_scopes</span>(<span class="sig-arg">credentials</span>,
264        <span class="sig-arg">scopes</span>)</span>
265  </h3>
266  </td><td align="right" valign="top"
267    ><span class="codelink"><a href="googleapiclient._auth-pysrc.html#with_scopes">source&nbsp;code</a></span>&nbsp;
268    </td>
269  </tr></table>
270
271  <pre class="literalblock">
272Scopes the credentials if necessary.
273
274Args:
275    credentials (Union[
276        google.auth.credentials.Credentials,
277        oauth2client.client.Credentials]): The credentials to scope.
278    scopes (Sequence[str]): The list of scopes.
279
280Returns:
281    Union[google.auth.credentials.Credentials,
282        oauth2client.client.Credentials]: The scoped credentials.
283
284</pre>
285  <dl class="fields">
286  </dl>
287</td></tr></table>
288</div>
289<a name="authorized_http"></a>
290<div>
291<table class="details" border="1" cellpadding="3"
292       cellspacing="0" width="100%" bgcolor="white">
293<tr><td>
294  <table width="100%" cellpadding="0" cellspacing="0" border="0">
295  <tr valign="top"><td>
296  <h3 class="epydoc"><span class="sig"><span class="sig-name">authorized_http</span>(<span class="sig-arg">credentials</span>)</span>
297  </h3>
298  </td><td align="right" valign="top"
299    ><span class="codelink"><a href="googleapiclient._auth-pysrc.html#authorized_http">source&nbsp;code</a></span>&nbsp;
300    </td>
301  </tr></table>
302
303  <pre class="literalblock">
304Returns an http client that is authorized with the given credentials.
305
306Args:
307    credentials (Union[
308        google.auth.credentials.Credentials,
309        oauth2client.client.Credentials]): The credentials to use.
310
311Returns:
312    Union[httplib2.Http, google_auth_httplib2.AuthorizedHttp]: An
313        authorized http client.
314
315</pre>
316  <dl class="fields">
317  </dl>
318</td></tr></table>
319</div>
320<br />
321<!-- ==================== NAVIGATION BAR ==================== -->
322<table class="navbar" border="0" width="100%" cellpadding="0"
323       bgcolor="#a0c0ff" cellspacing="0">
324  <tr valign="middle">
325  <!-- Home link -->
326      <th>&nbsp;&nbsp;&nbsp;<a
327        href="googleapiclient-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
328
329  <!-- Tree link -->
330      <th>&nbsp;&nbsp;&nbsp;<a
331        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
332
333  <!-- Index link -->
334      <th>&nbsp;&nbsp;&nbsp;<a
335        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
336
337  <!-- Help link -->
338      <th>&nbsp;&nbsp;&nbsp;<a
339        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
340
341      <th class="navbar" width="100%"></th>
342  </tr>
343</table>
344<table border="0" cellpadding="0" cellspacing="0" width="100%%">
345  <tr>
346    <td align="left" class="footer">
347    Generated by Epydoc 3.0.1 on Fri Jun 14 15:57:27 2019
348    </td>
349    <td align="right" class="footer">
350      <a target="mainFrame" href="http://epydoc.sourceforge.net"
351        >http://epydoc.sourceforge.net</a>
352    </td>
353  </tr>
354</table>
355
356<script type="text/javascript">
357  <!--
358  // Private objects are initially displayed (because if
359  // javascript is turned off then we want them to be
360  // visible); but by default, we want to hide them.  So hide
361  // them unless we have a cookie that says to show them.
362  checkCookie();
363  // -->
364</script>
365</body>
366</html>
367