|
| 1 | +Project: /docs/reference/js/_project.yaml |
| 2 | +Book: /docs/reference/_book.yaml |
| 3 | +page_type: reference |
| 4 | + |
| 5 | +{% comment %} |
| 6 | +DO NOT EDIT THIS FILE! |
| 7 | +This is generated by the JS SDK team, and any local changes will be |
| 8 | +overwritten. Changes should be made in the source code at |
| 9 | +https://github.com/firebase/firebase-js-sdk |
| 10 | +{% endcomment %} |
| 11 | + |
| 12 | +# TotpMultiFactorGenerator class |
| 13 | +Provider for generating a [TotpMultiFactorAssertion](./auth.totpmultifactorassertion.md#totpmultifactorassertion_interface)<!-- -->. |
| 14 | + |
| 15 | +<b>Signature:</b> |
| 16 | + |
| 17 | +```typescript |
| 18 | +export declare class TotpMultiFactorGenerator |
| 19 | +``` |
| 20 | + |
| 21 | +## Properties |
| 22 | + |
| 23 | +| Property | Modifiers | Type | Description | |
| 24 | +| --- | --- | --- | --- | |
| 25 | +| [FACTOR\_ID](./auth.totpmultifactorgenerator.md#totpmultifactorgeneratorfactor_id) | <code>static</code> | FactorId | The identifier of the TOTP second factor: <code>totp</code>. | |
| 26 | + |
| 27 | +## Methods |
| 28 | + |
| 29 | +| Method | Modifiers | Description | |
| 30 | +| --- | --- | --- | |
| 31 | +| [assertionForEnrollment(secret, oneTimePassword)](./auth.totpmultifactorgenerator.md#totpmultifactorgeneratorassertionforenrollment) | <code>static</code> | Provides a [TotpMultiFactorAssertion](./auth.totpmultifactorassertion.md#totpmultifactorassertion_interface) to confirm ownership of the totp(Time-based One Time Password) second factor. This assertion is used to complete enrollment in TOTP second factor. | |
| 32 | +| [assertionForSignIn(enrollmentId, oneTimePassword)](./auth.totpmultifactorgenerator.md#totpmultifactorgeneratorassertionforsignin) | <code>static</code> | Provides a [TotpMultiFactorAssertion](./auth.totpmultifactorassertion.md#totpmultifactorassertion_interface) to confirm ownership of the totp second factor. This assertion is used to complete signIn with TOTP as the second factor. | |
| 33 | +| [generateSecret(session)](./auth.totpmultifactorgenerator.md#totpmultifactorgeneratorgeneratesecret) | <code>static</code> | Returns a promise to 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 QRCode URL or inputting into a TOTP App. This method uses the auth instance corresponding to the user in the multiFactorSession. | |
| 34 | + |
| 35 | +## TotpMultiFactorGenerator.FACTOR\_ID |
| 36 | + |
| 37 | +The identifier of the TOTP second factor: `totp`<!-- -->. |
| 38 | + |
| 39 | +<b>Signature:</b> |
| 40 | + |
| 41 | +```typescript |
| 42 | +static FACTOR_ID: FactorId; |
| 43 | +``` |
| 44 | + |
| 45 | +## TotpMultiFactorGenerator.assertionForEnrollment() |
| 46 | + |
| 47 | +Provides a [TotpMultiFactorAssertion](./auth.totpmultifactorassertion.md#totpmultifactorassertion_interface) to confirm ownership of the totp(Time-based One Time Password) second factor. This assertion is used to complete enrollment in TOTP second factor. |
| 48 | + |
| 49 | +<b>Signature:</b> |
| 50 | + |
| 51 | +```typescript |
| 52 | +static assertionForEnrollment(secret: TotpSecret, oneTimePassword: string): TotpMultiFactorAssertion; |
| 53 | +``` |
| 54 | + |
| 55 | +### Parameters |
| 56 | + |
| 57 | +| Parameter | Type | Description | |
| 58 | +| --- | --- | --- | |
| 59 | +| secret | [TotpSecret](./auth.totpsecret.md#totpsecret_class) | [TotpSecret](./auth.totpsecret.md#totpsecret_class)<!-- -->. | |
| 60 | +| oneTimePassword | string | One-time password from TOTP App. | |
| 61 | + |
| 62 | +<b>Returns:</b> |
| 63 | + |
| 64 | +[TotpMultiFactorAssertion](./auth.totpmultifactorassertion.md#totpmultifactorassertion_interface) |
| 65 | + |
| 66 | +A [TotpMultiFactorAssertion](./auth.totpmultifactorassertion.md#totpmultifactorassertion_interface) which can be used with [MultiFactorUser.enroll()](./auth.multifactoruser.md#multifactoruserenroll)<!-- -->. |
| 67 | + |
| 68 | +## TotpMultiFactorGenerator.assertionForSignIn() |
| 69 | + |
| 70 | +Provides a [TotpMultiFactorAssertion](./auth.totpmultifactorassertion.md#totpmultifactorassertion_interface) to confirm ownership of the totp second factor. This assertion is used to complete signIn with TOTP as the second factor. |
| 71 | + |
| 72 | +<b>Signature:</b> |
| 73 | + |
| 74 | +```typescript |
| 75 | +static assertionForSignIn(enrollmentId: string, oneTimePassword: string): TotpMultiFactorAssertion; |
| 76 | +``` |
| 77 | + |
| 78 | +### Parameters |
| 79 | + |
| 80 | +| Parameter | Type | Description | |
| 81 | +| --- | --- | --- | |
| 82 | +| enrollmentId | string | identifies the enrolled TOTP second factor. | |
| 83 | +| oneTimePassword | string | One-time password from TOTP App. | |
| 84 | + |
| 85 | +<b>Returns:</b> |
| 86 | + |
| 87 | +[TotpMultiFactorAssertion](./auth.totpmultifactorassertion.md#totpmultifactorassertion_interface) |
| 88 | + |
| 89 | +A [TotpMultiFactorAssertion](./auth.totpmultifactorassertion.md#totpmultifactorassertion_interface) which can be used with [MultiFactorResolver.resolveSignIn()](./auth.multifactorresolver.md#multifactorresolverresolvesignin)<!-- -->. |
| 90 | + |
| 91 | +## TotpMultiFactorGenerator.generateSecret() |
| 92 | + |
| 93 | +Returns a promise to 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 QRCode URL or inputting into a TOTP App. This method uses the auth instance corresponding to the user in the multiFactorSession. |
| 94 | + |
| 95 | +<b>Signature:</b> |
| 96 | + |
| 97 | +```typescript |
| 98 | +static generateSecret(session: MultiFactorSession): Promise<TotpSecret>; |
| 99 | +``` |
| 100 | + |
| 101 | +### Parameters |
| 102 | + |
| 103 | +| Parameter | Type | Description | |
| 104 | +| --- | --- | --- | |
| 105 | +| session | [MultiFactorSession](./auth.multifactorsession.md#multifactorsession_interface) | A link to . | |
| 106 | + |
| 107 | +<b>Returns:</b> |
| 108 | + |
| 109 | +Promise<[TotpSecret](./auth.totpsecret.md#totpsecret_class)<!-- -->> |
| 110 | + |
| 111 | +A promise to [TotpSecret](./auth.totpsecret.md#totpsecret_class)<!-- -->. |
| 112 | + |
0 commit comments