MFA(多要素認証)の音声チャレンジ画面の実装です。
この画面は、ユーザーが多要素認証フローの一環として音声通話で
本人確認を行う必要がある場合に表示されます。
const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.continue({
code: '123456',
rememberDevice: true
});
MfaVoiceChallenge のインスタンスを作成します。
MFA(多要素認証)チャレンジを検証するために、音声通話で受信した認証コードを送信します。コードが正常に検証されると解決される Promise です。const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.continue({
code: '123456',
rememberDevice: true
});
コンテキストからトランザクションエラーの配列を取得します。存在しない場合は空の配列を返します。トランザクションコンテキストからのエラーオブジェクトの配列です。
別の電話番号を選択するための画面に遷移します。画面遷移が完了すると解決される Promise です。const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.pickPhone();
認証コード付きの新しい音声通話を要求します。新しいコードが送信されると解決される Promise です。const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.resendCode();
ユーティリティ機能この画面用の、タイムアウト管理付きの再送機能を取得します。startResend メソッドを持つ ResendControl オブジェクトです。import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';
const mfaVoiceChallenge = new MfaVoiceChallenge();
const { startResend } = mfaVoiceChallenge.resendManager({
timeoutSeconds: 15,
onStatusChange: (remainingSeconds, isDisabled) => {
console.log(`Resend available in ${remainingSeconds}s, disabled: ${isDisabled}`);
},
onTimeout: () => {
console.log('Resend is now available');
}
});
// ユーザーが再送ボタンをクリックしたときに startResend を呼び出します
startResend();
音声通話ではなく、SMS による認証方法に切り替えます。切り替えが完了すると解決される Promise です。const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.switchToSms();
別の MFA(多要素認証)手段を選択する画面へ遷移します。画面遷移が完了すると解決される Promise です。const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.tryAnotherMethod();