mfa method

MfaWeb mfa({
  1. required String mfaToken,
})

Creates an MfaWeb instance for completing a Multi-Factor Authentication flow with the given mfaToken.

Obtain the mfaToken from a WebException with code == 'MFA_REQUIRED' (its details['mfaToken']) that was thrown by a previous authentication call (such as credentials or customTokenExchange) on this same Auth0Web instance.

Note: This is backed by the auth0-spa-js programmatic MFA API and requires auth0-spa-js v2.21.0 or later. The MFA context is stored on the underlying Auth0Client, so this must be called on the same Auth0Web instance that triggered the MFA_REQUIRED error.

Usage example

final mfa = auth0Web.mfa(mfaToken: mfaToken);
final authenticators = await mfa.getAuthenticators();
final credentials = await mfa.verifyOtp(otp: '123456');

Implementation

MfaWeb mfa({required final String mfaToken}) => MfaWeb(mfaToken);