Skip to main content
The MfaVoiceChallenge class implemnents the mfa-voice-challenge screen functionality. This screen is displayed when a user needs to verify their identity using a voice call as part of a multi-factor authentication flow.
MfaRecoveryCodeEnrollment

Constructors

Create an instance of MfaVoiceChallenge screen
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';
const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.continue({
  code: '123456',
  rememberDevice: true
});

Properties

branding
Provides branding-related configurations, such as branding theme and settings.
client
Provides client-related configurations, such as id, name, and logoUrl.
organization
Provides information about the user’s organization, such as organization id and name.
prompt
Contains data about the current prompt in the authentication flow.
screen
Contains details specific to the mfa-voice-challenge screen, including its configuration and context.
tenant
Contains data related to the tenant, such as id and associated metadata.
transaction
Provides transaction-specific data, such as active identifiers and flow states.
untrustedData
Handles untrusted data passed to the SDK, such as user input during login.
user
Details of the active user, including username, email, and roles.

Methods

continue
(options ?)
This method submits the voice verification code to validate the MFA challenge. Returns a promise that resolves when the code is successfully validated.
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';
const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.continue({
  code: '123456',
  rememberDevice: true
});
options
OPTIONAL
An object containing the verification code and optional parameters
getErrors
This method retrieves the array of transaction errors from the context, or an empty array if none exist.
pickPhone
(options ?)
This method navigates to the screen for selecting a different phone number. Returns a promise that resolves when navigation is complete.
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';
const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.pickPhone();
options
OPTIONAL
An object containing any custom options.
resendCode
(options ?)
This method requests a new voice call with a verification code. Returns a promise that resolves when the new code is sent
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';
const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.resendCode();
options
OPTIONAL
An object containing any custom options.
resendManager
This method resends functionality with timeout management for this screen. Returns a ResendControl object with startResend method.
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');
  }
});

// Call startResend when user clicks resend button
startResend();
options
OPTIONAL
Optional custom options to include with the request.
switchToSms
(options ?)
This mehtod wwitches to SMS verification method instead of voice call. Returns a promise that resolves when switching is complete.
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';

const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.switchToSms();
options
OPTIONAL
Optional custom options to include with the request.
tryAnotherMethod
(options ?)
This method navigates to the screen for selecting an alternative MFA method. Returns a promise that resolves when navigation is complete.
Example
import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge';

const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.tryAnotherMethod();
options
OPTIONAL
Optional custom options to include with the request.