TotpMultiFactorAssertionを生成するためのプロバイダー。
時間ベースの OTP を生成するための共有秘密キーとその他のパラメーターを保存します。共有秘密キーを取得し、QR コード URL を生成するメソッドを実装します。
サイン:
export declare class TotpSecret
プロパティ
財産 | 修飾子 | タイプ | 説明 |
---|---|---|---|
コード間隔秒 | 番号 | OTP コードを変更する間隔 (秒単位)。 | |
コードの長さ | 番号 | 生成されるワンタイムパスワードの長さ。 | |
入学手続き完了締切 | 弦 | TOTP 登録が完了するまでのタイムスタンプ (UTC 文字列)。 | |
ハッシュアルゴリズム | 弦 | ハッシュアルゴリズムが使用されています。 | |
秘密鍵 | 弦 | TOTP MFA への登録と OTP の生成に使用される共有秘密キー/シード。 |
メソッド
方法 | 修飾子 | 説明 |
---|---|---|
generateQrCodeUrl(アカウント名、発行者) | https://github.com/google/google-authenticator/wiki/Key-Uri-Format で説明されているように、QR コード URL を返します。これは、Google Authenticator などの TOTP アプリにスキャンされる QR コードとしてユーザーに表示できます。 。オプションのパラメータが指定されていない場合、accountName は |
TotpSecret.codeIntervalSeconds
OTP コードを変更する間隔 (秒単位)。
サイン:
readonly codeIntervalSeconds: number;
TotpSecret.codeLength
生成されるワンタイムパスワードの長さ。
サイン:
readonly codeLength: number;
TotpSecret.enrollment完了期限
TOTP 登録が完了するまでのタイムスタンプ (UTC 文字列)。
サイン:
readonly enrollmentCompletionDeadline: string;
TotpSecret.hashingアルゴリズム
ハッシュアルゴリズムが使用されています。
サイン:
readonly hashingAlgorithm: string;
TotpSecret.secretKey
TOTP MFA への登録と OTP の生成に使用される共有秘密キー/シード。
サイン:
readonly secretKey: string;
TotpSecret.generateQrCodeUrl()
https://github.com/google/google-authenticator/wiki/Key-Uri-Format で説明されているように、QR コード URL を返します。これは、Google Authenticator などの TOTP アプリにスキャンされる QR コードとしてユーザーに表示できます。 。オプションのパラメータが指定されていない場合、accountName は
サイン:
generateQrCodeUrl(accountName?: string, issuer?: string): string;
パラメーター
パラメータ | タイプ | 説明 |
---|---|---|
アカウント名 | 弦 | アカウント/アプリの名前とユーザー識別子。 |
発行者 | 弦 | TOTP の発行者 (おそらくアプリ名)。 |
戻り値:
弦
QRコードのURL文字列。