docs-devsite/auth.totpsecret.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<!-- -->.
Stores the shared secret key and other parameters to generate time-based OTPs. Implements methods to retrieve the shared secret key and generate a QR code URL.
<b>Signature:</b>
export declare class TotpSecret
| Property | Modifiers | Type | Description |
|---|---|---|---|
| codeIntervalSeconds | number | The interval (in seconds) when the OTP codes should change. | |
| codeLength | number | Length of the one-time passwords to be generated. | |
| enrollmentCompletionDeadline | string | The timestamp (UTC string) by which TOTP enrollment should be completed. | |
| hashingAlgorithm | string | Hashing algorithm used. | |
| secretKey | string | Shared secret key/seed used for enrolling in TOTP MFA and generating OTPs. |
| Method | Modifiers | Description |
|---|---|---|
| generateQrCodeUrl(accountName, issuer) | Returns a QR code URL as described in https://github.com/google/google-authenticator/wiki/Key-Uri-Format This can be displayed to the user as a QR code to be scanned into a TOTP app like Google Authenticator. If the optional parameters are unspecified, an accountName of <userEmail> and issuer of <firebaseAppName> are used. |
The interval (in seconds) when the OTP codes should change.
<b>Signature:</b>
readonly codeIntervalSeconds: number;
Length of the one-time passwords to be generated.
<b>Signature:</b>
readonly codeLength: number;
The timestamp (UTC string) by which TOTP enrollment should be completed.
<b>Signature:</b>
readonly enrollmentCompletionDeadline: string;
Hashing algorithm used.
<b>Signature:</b>
readonly hashingAlgorithm: string;
Shared secret key/seed used for enrolling in TOTP MFA and generating OTPs.
<b>Signature:</b>
readonly secretKey: string;
Returns a QR code URL as described in https://github.com/google/google-authenticator/wiki/Key-Uri-Format This can be displayed to the user as a QR code to be scanned into a TOTP app like Google Authenticator. If the optional parameters are unspecified, an accountName of <userEmail> and issuer of <firebaseAppName> are used.
<b>Signature:</b>
generateQrCodeUrl(accountName?: string, issuer?: string): string;
| Parameter | Type | Description |
|---|---|---|
| accountName | string | the name of the account/app along with a user identifier. |
| issuer | string | issuer of the TOTP (likely the app name). |
<b>Returns:</b>
string
A QR code URL string.