TotpSecret class Stay organized with collections Save and categorize content based on your preferences.
Provider for generating aTotpMultiFactorAssertion.
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.
Signature:
exportdeclareclassTotpSecretProperties
| 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. |
Methods
| 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 |
TotpSecret.codeIntervalSeconds
The interval (in seconds) when the OTP codes should change.
Signature:
readonlycodeIntervalSeconds:number;TotpSecret.codeLength
Length of the one-time passwords to be generated.
Signature:
readonlycodeLength:number;TotpSecret.enrollmentCompletionDeadline
The timestamp (UTC string) by which TOTP enrollment should be completed.
Signature:
readonlyenrollmentCompletionDeadline:string;TotpSecret.hashingAlgorithm
Hashing algorithm used.
Signature:
readonlyhashingAlgorithm:string;TotpSecret.secretKey
Shared secret key/seed used for enrolling in TOTP MFA and generating OTPs.
Signature:
readonlysecretKey:string;TotpSecret.generateQrCodeUrl()
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
Signature:
generateQrCodeUrl(accountName?:string,issuer?:string):string;Parameters
| 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). |
Returns:
string
A QR code URL string.
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.