UNPKG

2.73 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2020 Google LLC
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17import { PhoneOrOauthTokenResponse } from '../api/authentication/mfa';
18/**
19 * Raw encoded JWT
20 *
21 */
22export declare type IdToken = string;
23/**
24 * Raw parsed JWT
25 *
26 */
27export interface ParsedIdToken {
28 iss: string;
29 aud: string;
30 exp: number;
31 sub: string;
32 iat: number;
33 email?: string;
34 verified: boolean;
35 providerId?: string;
36 tenantId?: string;
37 anonymous: boolean;
38 federatedId?: string;
39 displayName?: string;
40 photoURL?: string;
41 toString(): string;
42}
43/**
44 * IdToken as returned by the API
45 *
46 * @internal
47 */
48export interface IdTokenResponse {
49 localId: string;
50 idToken?: IdToken;
51 refreshToken?: string;
52 expiresIn?: string;
53 providerId?: string;
54 displayName?: string | null;
55 isNewUser?: boolean;
56 kind?: IdTokenResponseKind;
57 photoUrl?: string | null;
58 rawUserInfo?: string;
59 screenName?: string | null;
60}
61/**
62 * The possible types of the `IdTokenResponse`
63 *
64 * @internal
65 */
66export declare const enum IdTokenResponseKind {
67 CreateAuthUri = "identitytoolkit#CreateAuthUriResponse",
68 DeleteAccount = "identitytoolkit#DeleteAccountResponse",
69 DownloadAccount = "identitytoolkit#DownloadAccountResponse",
70 EmailLinkSignin = "identitytoolkit#EmailLinkSigninResponse",
71 GetAccountInfo = "identitytoolkit#GetAccountInfoResponse",
72 GetOobConfirmationCode = "identitytoolkit#GetOobConfirmationCodeResponse",
73 GetRecaptchaParam = "identitytoolkit#GetRecaptchaParamResponse",
74 ResetPassword = "identitytoolkit#ResetPasswordResponse",
75 SetAccountInfo = "identitytoolkit#SetAccountInfoResponse",
76 SignupNewUser = "identitytoolkit#SignupNewUserResponse",
77 UploadAccount = "identitytoolkit#UploadAccountResponse",
78 VerifyAssertion = "identitytoolkit#VerifyAssertionResponse",
79 VerifyCustomToken = "identitytoolkit#VerifyCustomTokenResponse",
80 VerifyPassword = "identitytoolkit#VerifyPasswordResponse"
81}
82/**
83 * @internal
84 */
85export interface TaggedWithTokenResponse {
86 _tokenResponse?: PhoneOrOauthTokenResponse;
87}