blob: 24429ca940b2096940644b765634ff09a4839af6 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="identitytoolkit_v3.html">Google Identity Toolkit API</a> . <a href="identitytoolkit_v3.relyingparty.html">relyingparty</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#createAuthUri">createAuthUri(body)</a></code></p>
79<p class="firstline">Creates the URI used by the IdP to authenticate the user.</p>
80<p class="toc_element">
81 <code><a href="#deleteAccount">deleteAccount(body)</a></code></p>
82<p class="firstline">Delete user account.</p>
83<p class="toc_element">
84 <code><a href="#downloadAccount">downloadAccount(body)</a></code></p>
85<p class="firstline">Batch download user accounts.</p>
86<p class="toc_element">
87 <code><a href="#getAccountInfo">getAccountInfo(body)</a></code></p>
88<p class="firstline">Returns the account info.</p>
89<p class="toc_element">
90 <code><a href="#getOobConfirmationCode">getOobConfirmationCode(body)</a></code></p>
91<p class="firstline">Get a code for user action confirmation.</p>
92<p class="toc_element">
93 <code><a href="#getPublicKeys">getPublicKeys()</a></code></p>
94<p class="firstline">Get token signing public key.</p>
95<p class="toc_element">
96 <code><a href="#resetPassword">resetPassword(body)</a></code></p>
97<p class="firstline">Set account info for a user.</p>
98<p class="toc_element">
99 <code><a href="#setAccountInfo">setAccountInfo(body)</a></code></p>
100<p class="firstline">Set account info for a user.</p>
101<p class="toc_element">
102 <code><a href="#uploadAccount">uploadAccount(body)</a></code></p>
103<p class="firstline">Batch upload existing user accounts.</p>
104<p class="toc_element">
105 <code><a href="#verifyAssertion">verifyAssertion(body)</a></code></p>
106<p class="firstline">Verifies the assertion returned by the IdP.</p>
107<p class="toc_element">
108 <code><a href="#verifyPassword">verifyPassword(body)</a></code></p>
109<p class="firstline">Verifies the user entered password.</p>
110<h3>Method Details</h3>
111<div class="method">
112 <code class="details" id="createAuthUri">createAuthUri(body)</code>
113 <pre>Creates the URI used by the IdP to authenticate the user.
114
115Args:
116 body: object, The request body. (required)
117 The object takes the form of:
118
119{ # Request to get the IDP authentication URL.
120 "identifier": "A String", # The email or federated ID of the user.
121 "clientId": "A String", # The relying party OAuth client ID.
122 "otaApp": "A String", # The native app package for OTA installation.
123 "providerId": "A String", # The IdP ID. For white listed IdPs it's a short domain name e.g. google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier.
124 "context": "A String", # The opaque value used by the client to maintain context info between the authentication request and the IDP callback.
125 "appId": "A String", # The app ID of the mobile app, base64(CERT_SHA1):PACKAGE_NAME for Android, BUNDLE_ID for iOS.
126 "continueUri": "A String", # The URI to which the IDP redirects the user after the federated login flow.
127 "openidRealm": "A String", # Optional realm for OpenID protocol. The sub string "scheme://domain:port" of the param "continueUri" is used if this is not set.
128 }
129
130
131Returns:
132 An object of the form:
133
134 { # Response of creating the IDP authentication URL.
135 "kind": "identitytoolkit#CreateAuthUriResponse", # The fixed string identitytoolkit#CreateAuthUriResponse".
136 "providers": [ # Existing IDP's for the user.
137 "A String",
138 ],
139 "registered": True or False, # Whether the user is registered if the identifier is an email.
140 "providerId": "A String", # The provider ID of the auth URI.
141 "authUri": "A String", # The URI used by the IDP to authenticate the user.
142 }</pre>
143</div>
144
145<div class="method">
146 <code class="details" id="deleteAccount">deleteAccount(body)</code>
147 <pre>Delete user account.
148
149Args:
150 body: object, The request body. (required)
151 The object takes the form of:
152
153{ # Request to delete account.
154 "localId": "A String", # The local ID of the user.
155 }
156
157
158Returns:
159 An object of the form:
160
161 { # Respone of deleting account.
162 "kind": "identitytoolkit#DeleteAccountResponse", # The fixed string "identitytoolkit#DeleteAccountResponse".
163 }</pre>
164</div>
165
166<div class="method">
167 <code class="details" id="downloadAccount">downloadAccount(body)</code>
168 <pre>Batch download user accounts.
169
170Args:
171 body: object, The request body. (required)
172 The object takes the form of:
173
174{ # Request to download user account in batch.
175 "nextPageToken": "A String", # The token for the next page. This should be taken from the previous response.
176 "maxResults": 42, # The max number of results to return in the response.
177 }
178
179
180Returns:
181 An object of the form:
182
183 { # Respone of downloading accounts in batch.
184 "nextPageToken": "A String", # The next page token. To be used in a subsequent request to return the next page of results.
185 "kind": "identitytoolkit#DownloadAccountResponse", # The fixed string "identitytoolkit#DownloadAccountResponse".
186 "users": [ # The user accounts data.
187 { # Template for an individual account info.
188 "displayName": "A String", # The name of the user.
189 "localId": "A String", # The local ID of the user.
190 "photoUrl": "A String", # The URL of the user profile photo.
191 "emailVerified": True or False, # Whether the email has been verified.
192 "passwordHash": "A String", # The user's hashed password.
193 "version": 42, # Version of the user's password.
194 "providerUserInfo": [ # The IDP of the user.
195 {
196 "federatedId": "A String", # User's identifier at IDP.
197 "providerId": "A String", # The IdP ID. For white listed IdPs it's a short domain name, e.g., google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier.
198 "displayName": "A String", # The user's display name at the IDP.
199 "photoUrl": "A String", # The user's photo url at the IDP.
200 },
201 ],
202 "passwordUpdatedAt": 3.14, # The timestamp when the password was last updated.
203 "salt": "A String", # The user's password salt.
204 "email": "A String", # The email of the user.
205 },
206 ],
207 }</pre>
208</div>
209
210<div class="method">
211 <code class="details" id="getAccountInfo">getAccountInfo(body)</code>
212 <pre>Returns the account info.
213
214Args:
215 body: object, The request body. (required)
216 The object takes the form of:
217
218{ # Request to get the account information.
219 "idToken": "A String", # The GITKit token of the authenticated user.
220 "email": [ # The list of emails of the users to inquiry.
221 "A String",
222 ],
223 "localId": [ # The list of local ID's of the users to inquiry.
224 "A String",
225 ],
226 }
227
228
229Returns:
230 An object of the form:
231
232 { # Response of getting account information.
233 "kind": "identitytoolkit#GetAccountInfoResponse", # The fixed string "identitytoolkit#GetAccountInfoResponse".
234 "users": [ # The info of the users.
235 { # Template for an individual account info.
236 "displayName": "A String", # The name of the user.
237 "localId": "A String", # The local ID of the user.
238 "photoUrl": "A String", # The URL of the user profile photo.
239 "emailVerified": True or False, # Whether the email has been verified.
240 "passwordHash": "A String", # The user's hashed password.
241 "version": 42, # Version of the user's password.
242 "providerUserInfo": [ # The IDP of the user.
243 {
244 "federatedId": "A String", # User's identifier at IDP.
245 "providerId": "A String", # The IdP ID. For white listed IdPs it's a short domain name, e.g., google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier.
246 "displayName": "A String", # The user's display name at the IDP.
247 "photoUrl": "A String", # The user's photo url at the IDP.
248 },
249 ],
250 "passwordUpdatedAt": 3.14, # The timestamp when the password was last updated.
251 "salt": "A String", # The user's password salt.
252 "email": "A String", # The email of the user.
253 },
254 ],
255 }</pre>
256</div>
257
258<div class="method">
259 <code class="details" id="getOobConfirmationCode">getOobConfirmationCode(body)</code>
260 <pre>Get a code for user action confirmation.
261
262Args:
263 body: object, The request body. (required)
264 The object takes the form of:
265
266{ # Request of getting a code for user confirmation (reset password, change email etc.)
267 "kind": "identitytoolkit#relyingparty", # The fixed string "identitytoolkit#relyingparty".
268 "requestType": "A String", # The request type.
269 "idToken": "A String", # The user's Gitkit login token for email change.
270 "challenge": "A String", # The recaptcha challenge presented to the user.
271 "newEmail": "A String", # The new email if the code is for email change.
272 "userIp": "A String", # The IP address of the user.
273 "email": "A String", # The email of the user.
274 "captchaResp": "A String", # The recaptcha response from the user.
275 }
276
277
278Returns:
279 An object of the form:
280
281 { # Response of getting a code for user confirmation (reset password, change email etc.).
282 "kind": "identitytoolkit#GetOobConfirmationCodeResponse", # The fixed string "identitytoolkit#GetOobConfirmationCodeResponse".
283 "oobCode": "A String", # The code to be send to the user.
284 }</pre>
285</div>
286
287<div class="method">
288 <code class="details" id="getPublicKeys">getPublicKeys()</code>
289 <pre>Get token signing public key.
290
291Args:
292
293Returns:
294 An object of the form:
295
296 { # Respone of getting public keys.
297 "a_key": "A String",
298 }</pre>
299</div>
300
301<div class="method">
302 <code class="details" id="resetPassword">resetPassword(body)</code>
303 <pre>Set account info for a user.
304
305Args:
306 body: object, The request body. (required)
307 The object takes the form of:
308
309{ # Request to reset the password.
310 "newPassword": "A String", # The new password inputted by the user.
311 "oldPassword": "A String", # The old password inputted by the user.
312 "oobCode": "A String", # The confirmation code.
313 "email": "A String", # The email address of the user.
314 }
315
316
317Returns:
318 An object of the form:
319
320 { # Response of resetting the password.
321 "kind": "identitytoolkit#ResetPasswordResponse", # The fixed string "identitytoolkit#ResetPasswordResponse".
322 "email": "A String", # The user's email.
323 }</pre>
324</div>
325
326<div class="method">
327 <code class="details" id="setAccountInfo">setAccountInfo(body)</code>
328 <pre>Set account info for a user.
329
330Args:
331 body: object, The request body. (required)
332 The object takes the form of:
333
334{ # Request to set the account information.
335 "displayName": "A String", # The name of the user.
336 "localId": "A String", # The local ID of the user.
337 "upgradeToFederatedLogin": True or False, # Mark the user to upgrade to federated login.
338 "captchaResponse": "A String", # Response to the captcha.
339 "idToken": "A String", # The GITKit token of the authenticated user.
340 "provider": [ # The associated IDPs of the user.
341 "A String",
342 ],
343 "captchaChallenge": "A String", # The captcha challenge.
344 "emailVerified": True or False, # Mark the email as verified or not.
345 "oobCode": "A String", # The out-of-band code of the change email request.
346 "password": "A String", # The new password of the user.
347 "email": "A String", # The email of the user.
348 }
349
350
351Returns:
352 An object of the form:
353
354 { # Respone of setting the account information.
355 "idToken": "A String", # The Gitkit id token to login the newly sign up user.
356 "kind": "identitytoolkit#SetAccountInfoResponse", # The fixed string "identitytoolkit#SetAccountInfoResponse".
357 "displayName": "A String", # The name of the user.
358 "email": "A String", # The email of the user.
359 "providerUserInfo": [ # The user's profiles at the associated IdPs.
360 {
361 "providerId": "A String", # The IdP ID. For whitelisted IdPs it's a short domain name, e.g., google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier.
362 "displayName": "A String", # The user's display name at the IDP.
363 "photoUrl": "A String", # The user's photo url at the IDP.
364 },
365 ],
366 }</pre>
367</div>
368
369<div class="method">
370 <code class="details" id="uploadAccount">uploadAccount(body)</code>
371 <pre>Batch upload existing user accounts.
372
373Args:
374 body: object, The request body. (required)
375 The object takes the form of:
376
377{ # Request to upload user account in batch.
378 "hashAlgorithm": "A String",
379 "users": [ # The account info to be stored.
380 { # Template for an individual account info.
381 "displayName": "A String", # The name of the user.
382 "localId": "A String", # The local ID of the user.
383 "photoUrl": "A String", # The URL of the user profile photo.
384 "emailVerified": True or False, # Whether the email has been verified.
385 "passwordHash": "A String", # The user's hashed password.
386 "version": 42, # Version of the user's password.
387 "providerUserInfo": [ # The IDP of the user.
388 {
389 "federatedId": "A String", # User's identifier at IDP.
390 "providerId": "A String", # The IdP ID. For white listed IdPs it's a short domain name, e.g., google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's the OP identifier.
391 "displayName": "A String", # The user's display name at the IDP.
392 "photoUrl": "A String", # The user's photo url at the IDP.
393 },
394 ],
395 "passwordUpdatedAt": 3.14, # The timestamp when the password was last updated.
396 "salt": "A String", # The user's password salt.
397 "email": "A String", # The email of the user.
398 },
399 ],
400 "signerKey": "A String",
401 "memoryCost": 42,
402 "saltSeparator": "A String",
403 "rounds": 42,
404 }
405
406
407Returns:
408 An object of the form:
409
410 { # Respone of uploading accounts in batch.
411 "kind": "identitytoolkit#UploadAccountResponse", # The fixed string "identitytoolkit#UploadAccountResponse".
412 "error": [ # The error encountered while processing the account info.
413 {
414 "index": 42, # The index of the malformed account, starting from 0.
415 "message": "A String", # Detailed error message for the account info.
416 },
417 ],
418 }</pre>
419</div>
420
421<div class="method">
422 <code class="details" id="verifyAssertion">verifyAssertion(body)</code>
423 <pre>Verifies the assertion returned by the IdP.
424
425Args:
426 body: object, The request body. (required)
427 The object takes the form of:
428
429{ # Request to verify the IDP assertion.
430 "requestUri": "A String", # The URI to which the IDP redirects the user back. It may contain federated login result params added by the IDP.
431 "postBody": "A String", # The post body if the request is a HTTP POST.
432 "pendingIdToken": "A String", # The GITKit token for the non-trusted IDP pending to be confirmed by the user.
433 }
434
435
436Returns:
437 An object of the form:
438
439 { # Response of verifying the IDP assertion.
440 "federatedId": "A String", # The unique ID identifies the IdP account.
441 "localId": "A String", # The RP local ID if it's already been mapped to the IdP account identified by the federated ID.
442 "photoUrl": "A String", # The URI of the public accessible profiel picture.
443 "inputEmail": "A String", # It's the identifier param in the createAuthUri request if the identifier is an email. It can be used to check whether the user input email is different from the asserted email.
444 "appScheme": "A String", # The custom scheme used by mobile app.
445 "verifiedProvider": [ # When action is 'map', contains the idps which can be used for confirmation.
446 "A String",
447 ],
448 "providerId": "A String", # The IdP ID. For white listed IdPs it's a short domain name e.g. google.com, aol.com, live.net and yahoo.com. If the "providerId" param is set to OpenID OP identifer other than the whilte listed IdPs the OP identifier is returned. If the "identifier" param is federated ID in the createAuthUri request. The domain part of the federated ID is returned.
449 "dateOfBirth": "A String", # The birth date of the IdP account.
450 "nickName": "A String", # The nick name of the user.
451 "email": "A String", # The email returned by the IdP. NOTE: The federated login user may not own the email.
452 "language": "A String", # The language preference of the user.
453 "needConfirmation": True or False, # Whether the assertion is from a non-trusted IDP and need account linking confirmation.
454 "fullName": "A String", # The full name of the user.
455 "kind": "identitytoolkit#VerifyAssertionResponse", # The fixed string "identitytoolkit#VerifyAssertionResponse".
456 "idToken": "A String", # The ID token.
457 "displayName": "A String", # The display name of the user.
458 "appInstallationUrl": "A String", # URL for OTA app installation.
459 "firstName": "A String", # The first name of the user.
460 "emailVerified": True or False, # The value is true if the IDP is also the email provider. It means the user owns the email.
461 "oauthScope": "A String", # The scope for the OpenID OAuth extension.
462 "oauthRequestToken": "A String", # The user approved request token for the OpenID OAuth extension.
463 "originalEmail": "A String", # The original email stored in the mapping storage. It's returned when the federated ID is associated to a different email.
464 "context": "A String", # The opaque value used by the client to maintain context info between the authentication request and the IDP callback.
465 "lastName": "A String", # The last name of the user.
466 "action": "A String", # The action code.
467 "timeZone": "A String", # The timezone of the user.
468 "emailRecycled": True or False, # It's true if the email is recycled.
469 }</pre>
470</div>
471
472<div class="method">
473 <code class="details" id="verifyPassword">verifyPassword(body)</code>
474 <pre>Verifies the user entered password.
475
476Args:
477 body: object, The request body. (required)
478 The object takes the form of:
479
480{ # Request to verify the password.
481 "captchaResponse": "A String", # Response to the captcha.
482 "captchaChallenge": "A String", # The captcha challenge.
483 "password": "A String", # The password inputed by the user.
484 "email": "A String", # The email of the user.
485 "pendingIdToken": "A String", # The GITKit token for the non-trusted IDP, which is to be confirmed by the user.
486 }
487
488
489Returns:
490 An object of the form:
491
492 { # Request of verifying the password.
493 "kind": "identitytoolkit#VerifyPasswordResponse", # The fixed string "identitytoolkit#VerifyPasswordResponse".
494 "displayName": "A String", # The name of the user.
495 "localId": "A String", # The RP local ID if it's already been mapped to the IdP account identified by the federated ID.
496 "photoUrl": "A String", # The URI of the user's photo at IdP
497 "idToken": "A String", # The GITKit token for authenticated user.
498 "registered": True or False, # Whether the email is registered.
499 "email": "A String", # The email returned by the IdP. NOTE: The federated login user may not own the email.
500 }</pre>
501</div>
502
503</body></html>