メインコンテンツへスキップ
MfaVoiceChallenge クラスは、mfa-voice-challenge 画面の機能を実装します。この画面は、ユーザーが本人確認のために音声通話で受信したコードを入力する必要がある場合に表示されます。
MfaVoiceChallenge

コンストラクター

MFA Voice Challenge画面マネージャーのインスタンスを作成します。
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';

const mfaVoiceChallenge = new MfaVoiceChallenge();
await mfaVoiceChallenge.continue({ code: '123456' });

プロパティ

ブランディングテーマや各種設定など、ブランディング関連の構成を提供します。
mfa-voice-challenge 画面の idnamelogoUrl など、クライアント関連の構成を提供します。
ユーザーの組織に関する情報 (idname など) を提供します。
認証フローにおける現在のプロンプトに関するデータを含みます。
設定やコンテキストなど、mfa-voice-challenge 画面に固有の詳細を含みます。
id や関連メタデータなど、テナントに関するデータを含みます。
アクティブな識別子やフローの状態など、mfa-voice-challenge 画面に関するトランザクション固有のデータを提供します。
MFA 音声チャレンジ中のユーザー入力など、SDK に渡される信頼できないデータを扱います。
usernameemailroles など、現在のユーザーの詳細です。

メソッド

changeLanguage
Promise<void>
このメソッドは、Universal Login ページの表示言語を変更します。
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';

const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.changeLanguage({
  language: 'fr',
});
メソッドパラメーター
continue
Promise<void>
このメソッドは、音声通話で受信した確認コードを送信して、MFA チャレンジを検証します。
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';

const mfaVoiceChallenge = new MfaVoiceChallenge();
await mfaVoiceChallenge.continue({
  code: '123456',
  rememberDevice: true,
});
メソッドパラメーター
getErrors
このメソッドは、コンテキストからトランザクションエラーの配列を取得します。エラーがない場合は空の配列を返します。
pickPhone
Promise<void>
このメソッドは、別の電話番号を選択できる画面に移動します。
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';

const mfaVoiceChallenge = new MfaVoiceChallenge();
await mfaVoiceChallenge.pickPhone();
resendCode
Promise<void>
このメソッドは、確認コードを含む新しい音声通話をリクエストします。
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';

const mfaVoiceChallenge = new MfaVoiceChallenge();
await mfaVoiceChallenge.resendCode();
resendManager
このメソッドは、タイムアウトやステータス管理を設定可能な再送機能を提供します。
Example
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();
メソッドパラメーター
switchToSms
Promise<void>
このメソッドは、認証方法を SMS に切り替えます。
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';

const mfaVoiceChallenge = new MfaVoiceChallenge();
await mfaVoiceChallenge.switchToSms();
tryAnotherMethod
Promise<void>
このメソッドを使用すると、ユーザーは別の MFA 方法を試すことができます。
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';

const mfaVoiceChallenge = new MfaVoiceChallenge();
await mfaVoiceChallenge.tryAnotherMethod();