docs-devsite/auth.totpmultifactorgenerator.md
Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
Provider for generating a TotpMultiFactorAssertion<!-- -->.
<b>Signature:</b>
export declare class TotpMultiFactorGenerator
| Property | Modifiers | Type | Description |
|---|---|---|---|
| FACTOR_ID | <code>static</code> | 'totp' | The identifier of the TOTP second factor: <code>totp</code>. |
| Method | Modifiers | Description |
|---|---|---|
| assertionForEnrollment(secret, oneTimePassword) | <code>static</code> | Provides a TotpMultiFactorAssertion to confirm ownership of the TOTP (time-based one-time password) second factor. This assertion is used to complete enrollment in TOTP second factor. |
| assertionForSignIn(enrollmentId, oneTimePassword) | <code>static</code> | Provides a TotpMultiFactorAssertion to confirm ownership of the TOTP second factor. This assertion is used to complete signIn with TOTP as the second factor. |
| generateSecret(session) | <code>static</code> | Returns a promise to TotpSecret which contains the TOTP shared secret key and other parameters. Creates a TOTP secret as part of enrolling a TOTP second factor. Used for generating a QR code URL or inputting into a TOTP app. This method uses the auth instance corresponding to the user in the multiFactorSession. |
The identifier of the TOTP second factor: totp<!-- -->.
<b>Signature:</b>
static FACTOR_ID: 'totp';
Provides a TotpMultiFactorAssertion to confirm ownership of the TOTP (time-based one-time password) second factor. This assertion is used to complete enrollment in TOTP second factor.
<b>Signature:</b>
static assertionForEnrollment(secret: TotpSecret, oneTimePassword: string): TotpMultiFactorAssertion;
| Parameter | Type | Description |
|---|---|---|
| secret | TotpSecret | A TotpSecret containing the shared secret key and other TOTP parameters. |
| oneTimePassword | string | One-time password from TOTP App. |
<b>Returns:</b>
A TotpMultiFactorAssertion which can be used with MultiFactorUser.enroll()<!-- -->.
Provides a TotpMultiFactorAssertion to confirm ownership of the TOTP second factor. This assertion is used to complete signIn with TOTP as the second factor.
<b>Signature:</b>
static assertionForSignIn(enrollmentId: string, oneTimePassword: string): TotpMultiFactorAssertion;
| Parameter | Type | Description |
|---|---|---|
| enrollmentId | string | identifies the enrolled TOTP second factor. |
| oneTimePassword | string | One-time password from TOTP App. |
<b>Returns:</b>
A TotpMultiFactorAssertion which can be used with MultiFactorResolver.resolveSignIn()<!-- -->.
Returns a promise to TotpSecret which contains the TOTP shared secret key and other parameters. Creates a TOTP secret as part of enrolling a TOTP second factor. Used for generating a QR code URL or inputting into a TOTP app. This method uses the auth instance corresponding to the user in the multiFactorSession.
<b>Signature:</b>
static generateSecret(session: MultiFactorSession): Promise<TotpSecret>;
| Parameter | Type | Description |
|---|---|---|
| session | MultiFactorSession | The MultiFactorSession that the user is part of. |
<b>Returns:</b>
Promise<TotpSecret<!-- -->>
A promise to TotpSecret<!-- -->.