TotpMultiFactorGenerator class Stay organized with collections Save and categorize content based on your preferences.
Provider for generating aTotpMultiFactorAssertion.
Signature:
exportdeclareclassTotpMultiFactorGeneratorProperties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| FACTOR_ID | static | 'totp' | The identifier of the TOTP second factor:totp. |
Methods
| Method | Modifiers | Description |
|---|---|---|
| assertionForEnrollment(secret, oneTimePassword) | static | Provides aTotpMultiFactorAssertion 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) | static | Provides aTotpMultiFactorAssertion to confirm ownership of the TOTP second factor. This assertion is used to complete signIn with TOTP as the second factor. |
| generateSecret(session) | static | Returns a promise toTotpSecret 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. |
TotpMultiFactorGenerator.FACTOR_ID
The identifier of the TOTP second factor:totp.
Signature:
staticFACTOR_ID:'totp';TotpMultiFactorGenerator.assertionForEnrollment()
Provides aTotpMultiFactorAssertion to confirm ownership of the TOTP (time-based one-time password) second factor. This assertion is used to complete enrollment in TOTP second factor.
Signature:
staticassertionForEnrollment(secret:TotpSecret,oneTimePassword:string):TotpMultiFactorAssertion;Parameters
| Parameter | Type | Description |
|---|---|---|
| secret | TotpSecret | ATotpSecret containing the shared secret key and other TOTP parameters. |
| oneTimePassword | string | One-time password from TOTP App. |
Returns:
ATotpMultiFactorAssertion which can be used withMultiFactorUser.enroll().
TotpMultiFactorGenerator.assertionForSignIn()
Provides aTotpMultiFactorAssertion to confirm ownership of the TOTP second factor. This assertion is used to complete signIn with TOTP as the second factor.
Signature:
staticassertionForSignIn(enrollmentId:string,oneTimePassword:string):TotpMultiFactorAssertion;Parameters
| Parameter | Type | Description |
|---|---|---|
| enrollmentId | string | identifies the enrolled TOTP second factor. |
| oneTimePassword | string | One-time password from TOTP App. |
Returns:
ATotpMultiFactorAssertion which can be used withMultiFactorResolver.resolveSignIn().
TotpMultiFactorGenerator.generateSecret()
Returns a promise toTotpSecret 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.
Signature:
staticgenerateSecret(session:MultiFactorSession):Promise<TotpSecret>;Parameters
| Parameter | Type | Description |
|---|---|---|
| session | MultiFactorSession | TheMultiFactorSession that the user is part of. |
Returns:
Promise<TotpSecret>
A promise toTotpSecret.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-01-19 UTC.