UNPKG

2.68 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';
18import { AuthInternal } from '../../model/auth';
19import { IdTokenResponse } from '../../model/id_token';
20/**
21 * Interface that represents the credentials returned by an {@link AuthProvider}.
22 *
23 * @remarks
24 * Implementations specify the details about each auth provider's credential requirements.
25 *
26 * @public
27 */
28export declare class AuthCredential {
29 /**
30 * The authentication provider ID for the credential.
31 *
32 * @remarks
33 * For example, 'facebook.com', or 'google.com'.
34 */
35 readonly providerId: string;
36 /**
37 * The authentication sign in method for the credential.
38 *
39 * @remarks
40 * For example, {@link SignInMethod}.EMAIL_PASSWORD, or
41 * {@link SignInMethod}.EMAIL_LINK. This corresponds to the sign-in method
42 * identifier as returned in {@link fetchSignInMethodsForEmail}.
43 */
44 readonly signInMethod: string;
45 /** @internal */
46 protected constructor(
47 /**
48 * The authentication provider ID for the credential.
49 *
50 * @remarks
51 * For example, 'facebook.com', or 'google.com'.
52 */
53 providerId: string,
54 /**
55 * The authentication sign in method for the credential.
56 *
57 * @remarks
58 * For example, {@link SignInMethod}.EMAIL_PASSWORD, or
59 * {@link SignInMethod}.EMAIL_LINK. This corresponds to the sign-in method
60 * identifier as returned in {@link fetchSignInMethodsForEmail}.
61 */
62 signInMethod: string);
63 /**
64 * Returns a JSON-serializable representation of this object.
65 *
66 * @returns a JSON-serializable representation of this object.
67 */
68 toJSON(): object;
69 /** @internal */
70 _getIdTokenResponse(_auth: AuthInternal): Promise<PhoneOrOauthTokenResponse>;
71 /** @internal */
72 _linkToIdToken(_auth: AuthInternal, _idToken: string): Promise<IdTokenResponse>;
73 /** @internal */
74 _getReauthenticationResolver(_auth: AuthInternal): Promise<IdTokenResponse>;
75}