blob: f3e52449a65c884f905dfd0e04536a4865c71596 [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>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070097<p class="firstline">Reset password for a user.</p>
John Asmuth614db982014-04-24 15:46:26 -040098<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".
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700136 "captchaRequired": True or False, # True if captcha is required.
John Asmuth614db982014-04-24 15:46:26 -0400137 "registered": True or False, # Whether the user is registered if the identifier is an email.
Craig Citro065b5302014-08-14 00:47:23 -0700138 "forExistingProvider": True or False, # True if the authUri is for user's existing provider.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700139 "providerId": "A String", # The provider ID of the auth URI.
John Asmuth614db982014-04-24 15:46:26 -0400140 "authUri": "A String", # The URI used by the IDP to authenticate the user.
141 }</pre>
142</div>
143
144<div class="method">
145 <code class="details" id="deleteAccount">deleteAccount(body)</code>
146 <pre>Delete user account.
147
148Args:
149 body: object, The request body. (required)
150 The object takes the form of:
151
152{ # Request to delete account.
153 "localId": "A String", # The local ID of the user.
154 }
155
156
157Returns:
158 An object of the form:
159
160 { # Respone of deleting account.
161 "kind": "identitytoolkit#DeleteAccountResponse", # The fixed string "identitytoolkit#DeleteAccountResponse".
162 }</pre>
163</div>
164
165<div class="method">
166 <code class="details" id="downloadAccount">downloadAccount(body)</code>
167 <pre>Batch download user accounts.
168
169Args:
170 body: object, The request body. (required)
171 The object takes the form of:
172
173{ # Request to download user account in batch.
174 "nextPageToken": "A String", # The token for the next page. This should be taken from the previous response.
175 "maxResults": 42, # The max number of results to return in the response.
176 }
177
178
179Returns:
180 An object of the form:
181
182 { # Respone of downloading accounts in batch.
183 "nextPageToken": "A String", # The next page token. To be used in a subsequent request to return the next page of results.
184 "kind": "identitytoolkit#DownloadAccountResponse", # The fixed string "identitytoolkit#DownloadAccountResponse".
185 "users": [ # The user accounts data.
186 { # Template for an individual account info.
187 "displayName": "A String", # The name of the user.
188 "localId": "A String", # The local ID of the user.
189 "photoUrl": "A String", # The URL of the user profile photo.
190 "emailVerified": True or False, # Whether the email has been verified.
191 "passwordHash": "A String", # The user's hashed password.
192 "version": 42, # Version of the user's password.
193 "providerUserInfo": [ # The IDP of the user.
194 {
195 "federatedId": "A String", # User's identifier at IDP.
196 "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.
197 "displayName": "A String", # The user's display name at the IDP.
198 "photoUrl": "A String", # The user's photo url at the IDP.
199 },
200 ],
201 "passwordUpdatedAt": 3.14, # The timestamp when the password was last updated.
202 "salt": "A String", # The user's password salt.
203 "email": "A String", # The email of the user.
204 },
205 ],
206 }</pre>
207</div>
208
209<div class="method">
210 <code class="details" id="getAccountInfo">getAccountInfo(body)</code>
211 <pre>Returns the account info.
212
213Args:
214 body: object, The request body. (required)
215 The object takes the form of:
216
217{ # Request to get the account information.
218 "idToken": "A String", # The GITKit token of the authenticated user.
219 "email": [ # The list of emails of the users to inquiry.
220 "A String",
221 ],
222 "localId": [ # The list of local ID's of the users to inquiry.
223 "A String",
224 ],
225 }
226
227
228Returns:
229 An object of the form:
230
231 { # Response of getting account information.
232 "kind": "identitytoolkit#GetAccountInfoResponse", # The fixed string "identitytoolkit#GetAccountInfoResponse".
233 "users": [ # The info of the users.
234 { # Template for an individual account info.
235 "displayName": "A String", # The name of the user.
236 "localId": "A String", # The local ID of the user.
237 "photoUrl": "A String", # The URL of the user profile photo.
238 "emailVerified": True or False, # Whether the email has been verified.
239 "passwordHash": "A String", # The user's hashed password.
240 "version": 42, # Version of the user's password.
241 "providerUserInfo": [ # The IDP of the user.
242 {
243 "federatedId": "A String", # User's identifier at IDP.
244 "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.
245 "displayName": "A String", # The user's display name at the IDP.
246 "photoUrl": "A String", # The user's photo url at the IDP.
247 },
248 ],
249 "passwordUpdatedAt": 3.14, # The timestamp when the password was last updated.
250 "salt": "A String", # The user's password salt.
251 "email": "A String", # The email of the user.
252 },
253 ],
254 }</pre>
255</div>
256
257<div class="method">
258 <code class="details" id="getOobConfirmationCode">getOobConfirmationCode(body)</code>
259 <pre>Get a code for user action confirmation.
260
261Args:
262 body: object, The request body. (required)
263 The object takes the form of:
264
265{ # Request of getting a code for user confirmation (reset password, change email etc.)
266 "kind": "identitytoolkit#relyingparty", # The fixed string "identitytoolkit#relyingparty".
267 "requestType": "A String", # The request type.
268 "idToken": "A String", # The user's Gitkit login token for email change.
269 "challenge": "A String", # The recaptcha challenge presented to the user.
270 "newEmail": "A String", # The new email if the code is for email change.
271 "userIp": "A String", # The IP address of the user.
272 "email": "A String", # The email of the user.
273 "captchaResp": "A String", # The recaptcha response from the user.
274 }
275
276
277Returns:
278 An object of the form:
279
280 { # Response of getting a code for user confirmation (reset password, change email etc.).
281 "kind": "identitytoolkit#GetOobConfirmationCodeResponse", # The fixed string "identitytoolkit#GetOobConfirmationCodeResponse".
282 "oobCode": "A String", # The code to be send to the user.
283 }</pre>
284</div>
285
286<div class="method">
287 <code class="details" id="getPublicKeys">getPublicKeys()</code>
288 <pre>Get token signing public key.
289
290Args:
291
292Returns:
293 An object of the form:
294
295 { # Respone of getting public keys.
296 "a_key": "A String",
297 }</pre>
298</div>
299
300<div class="method">
301 <code class="details" id="resetPassword">resetPassword(body)</code>
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700302 <pre>Reset password for a user.
John Asmuth614db982014-04-24 15:46:26 -0400303
304Args:
305 body: object, The request body. (required)
306 The object takes the form of:
307
308{ # Request to reset the password.
309 "newPassword": "A String", # The new password inputted by the user.
310 "oldPassword": "A String", # The old password inputted by the user.
311 "oobCode": "A String", # The confirmation code.
312 "email": "A String", # The email address of the user.
313 }
314
315
316Returns:
317 An object of the form:
318
319 { # Response of resetting the password.
320 "kind": "identitytoolkit#ResetPasswordResponse", # The fixed string "identitytoolkit#ResetPasswordResponse".
321 "email": "A String", # The user's email.
322 }</pre>
323</div>
324
325<div class="method">
326 <code class="details" id="setAccountInfo">setAccountInfo(body)</code>
327 <pre>Set account info for a user.
328
329Args:
330 body: object, The request body. (required)
331 The object takes the form of:
332
333{ # Request to set the account information.
334 "displayName": "A String", # The name of the user.
335 "localId": "A String", # The local ID of the user.
336 "upgradeToFederatedLogin": True or False, # Mark the user to upgrade to federated login.
337 "captchaResponse": "A String", # Response to the captcha.
338 "idToken": "A String", # The GITKit token of the authenticated user.
339 "provider": [ # The associated IDPs of the user.
340 "A String",
341 ],
342 "captchaChallenge": "A String", # The captcha challenge.
343 "emailVerified": True or False, # Mark the email as verified or not.
344 "oobCode": "A String", # The out-of-band code of the change email request.
345 "password": "A String", # The new password of the user.
346 "email": "A String", # The email of the user.
347 }
348
349
350Returns:
351 An object of the form:
352
353 { # Respone of setting the account information.
354 "idToken": "A String", # The Gitkit id token to login the newly sign up user.
355 "kind": "identitytoolkit#SetAccountInfoResponse", # The fixed string "identitytoolkit#SetAccountInfoResponse".
356 "displayName": "A String", # The name of the user.
357 "email": "A String", # The email of the user.
358 "providerUserInfo": [ # The user's profiles at the associated IdPs.
359 {
360 "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.
361 "displayName": "A String", # The user's display name at the IDP.
362 "photoUrl": "A String", # The user's photo url at the IDP.
363 },
364 ],
365 }</pre>
366</div>
367
368<div class="method">
369 <code class="details" id="uploadAccount">uploadAccount(body)</code>
370 <pre>Batch upload existing user accounts.
371
372Args:
373 body: object, The request body. (required)
374 The object takes the form of:
375
376{ # Request to upload user account in batch.
Craig Citro065b5302014-08-14 00:47:23 -0700377 "hashAlgorithm": "A String", # The password hash algorithm.
John Asmuth614db982014-04-24 15:46:26 -0400378 "users": [ # The account info to be stored.
379 { # Template for an individual account info.
380 "displayName": "A String", # The name of the user.
381 "localId": "A String", # The local ID of the user.
382 "photoUrl": "A String", # The URL of the user profile photo.
383 "emailVerified": True or False, # Whether the email has been verified.
384 "passwordHash": "A String", # The user's hashed password.
385 "version": 42, # Version of the user's password.
386 "providerUserInfo": [ # The IDP of the user.
387 {
388 "federatedId": "A String", # User's identifier at IDP.
389 "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.
390 "displayName": "A String", # The user's display name at the IDP.
391 "photoUrl": "A String", # The user's photo url at the IDP.
392 },
393 ],
394 "passwordUpdatedAt": 3.14, # The timestamp when the password was last updated.
395 "salt": "A String", # The user's password salt.
396 "email": "A String", # The email of the user.
397 },
398 ],
Craig Citro065b5302014-08-14 00:47:23 -0700399 "signerKey": "A String", # The key for to hash the password.
400 "memoryCost": 42, # Memory cost for hash calculation. Used by scrypt similar algorithms.
401 "saltSeparator": "A String", # The salt separator.
402 "rounds": 42, # Rounds for hash calculation. Used by scrypt and similar algorithms.
John Asmuth614db982014-04-24 15:46:26 -0400403 }
404
405
406Returns:
407 An object of the form:
408
409 { # Respone of uploading accounts in batch.
410 "kind": "identitytoolkit#UploadAccountResponse", # The fixed string "identitytoolkit#UploadAccountResponse".
411 "error": [ # The error encountered while processing the account info.
412 {
413 "index": 42, # The index of the malformed account, starting from 0.
414 "message": "A String", # Detailed error message for the account info.
415 },
416 ],
417 }</pre>
418</div>
419
420<div class="method">
421 <code class="details" id="verifyAssertion">verifyAssertion(body)</code>
422 <pre>Verifies the assertion returned by the IdP.
423
424Args:
425 body: object, The request body. (required)
426 The object takes the form of:
427
428{ # Request to verify the IDP assertion.
429 "requestUri": "A String", # The URI to which the IDP redirects the user back. It may contain federated login result params added by the IDP.
430 "postBody": "A String", # The post body if the request is a HTTP POST.
431 "pendingIdToken": "A String", # The GITKit token for the non-trusted IDP pending to be confirmed by the user.
432 }
433
434
435Returns:
436 An object of the form:
437
438 { # Response of verifying the IDP assertion.
439 "federatedId": "A String", # The unique ID identifies the IdP account.
440 "localId": "A String", # The RP local ID if it's already been mapped to the IdP account identified by the federated ID.
441 "photoUrl": "A String", # The URI of the public accessible profiel picture.
442 "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.
443 "appScheme": "A String", # The custom scheme used by mobile app.
444 "verifiedProvider": [ # When action is 'map', contains the idps which can be used for confirmation.
445 "A String",
446 ],
447 "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.
448 "dateOfBirth": "A String", # The birth date of the IdP account.
449 "nickName": "A String", # The nick name of the user.
450 "email": "A String", # The email returned by the IdP. NOTE: The federated login user may not own the email.
451 "language": "A String", # The language preference of the user.
452 "needConfirmation": True or False, # Whether the assertion is from a non-trusted IDP and need account linking confirmation.
453 "fullName": "A String", # The full name of the user.
454 "kind": "identitytoolkit#VerifyAssertionResponse", # The fixed string "identitytoolkit#VerifyAssertionResponse".
455 "idToken": "A String", # The ID token.
456 "displayName": "A String", # The display name of the user.
457 "appInstallationUrl": "A String", # URL for OTA app installation.
458 "firstName": "A String", # The first name of the user.
459 "emailVerified": True or False, # The value is true if the IDP is also the email provider. It means the user owns the email.
460 "oauthScope": "A String", # The scope for the OpenID OAuth extension.
461 "oauthRequestToken": "A String", # The user approved request token for the OpenID OAuth extension.
462 "originalEmail": "A String", # The original email stored in the mapping storage. It's returned when the federated ID is associated to a different email.
463 "context": "A String", # The opaque value used by the client to maintain context info between the authentication request and the IDP callback.
464 "lastName": "A String", # The last name of the user.
465 "action": "A String", # The action code.
466 "timeZone": "A String", # The timezone of the user.
467 "emailRecycled": True or False, # It's true if the email is recycled.
468 }</pre>
469</div>
470
471<div class="method">
472 <code class="details" id="verifyPassword">verifyPassword(body)</code>
473 <pre>Verifies the user entered password.
474
475Args:
476 body: object, The request body. (required)
477 The object takes the form of:
478
479{ # Request to verify the password.
480 "captchaResponse": "A String", # Response to the captcha.
481 "captchaChallenge": "A String", # The captcha challenge.
482 "password": "A String", # The password inputed by the user.
483 "email": "A String", # The email of the user.
484 "pendingIdToken": "A String", # The GITKit token for the non-trusted IDP, which is to be confirmed by the user.
485 }
486
487
488Returns:
489 An object of the form:
490
491 { # Request of verifying the password.
492 "kind": "identitytoolkit#VerifyPasswordResponse", # The fixed string "identitytoolkit#VerifyPasswordResponse".
493 "displayName": "A String", # The name of the user.
494 "localId": "A String", # The RP local ID if it's already been mapped to the IdP account identified by the federated ID.
495 "photoUrl": "A String", # The URI of the user's photo at IdP
496 "idToken": "A String", # The GITKit token for authenticated user.
497 "registered": True or False, # Whether the email is registered.
498 "email": "A String", # The email returned by the IdP. NOTE: The federated login user may not own the email.
499 }</pre>
500</div>
501
502</body></html>