MfaModule class

Module for managing Multi-Factor Authentication (MFA) devices and operations.

This module provides methods to add, verify, authenticate, and manage MFA devices such as TOTP authenticators, passkeys, and email-based MFA. It also handles recovery codes and MFA completion callbacks.

Constructors

MfaModule(StreamController<Message> messageTransport, {@visibleForTesting RequestChannel? requestChannel})
Creates a new MfaModule instance.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addDevice({String? type}) → Future<MfaAddDevice>
Adds a new MFA device for the authenticated user.
authDevice(MfaAuthenticateDevice params) → Future<bool>
Authenticates using an MFA device (deprecated, use authenticateDevice instead).
authenticateDevice({required MfaAuthenticateDevice params}) → Future<String?>
Authenticates using an MFA device and optionally returns an MFA token.
authenticateRecoveryCode({required MfaAuthenticateRecoveryCode code}) → Future<String?>
Authenticates using a recovery code and optionally returns an MFA token.
authRecoveryCode(String code) → Future<bool>
Authenticates using a recovery code (deprecated, use authenticateRecoveryCode instead).
completeAcknowledgement() → Future<void>
Completes the acknowledgment of recovery codes.
deleteUserDevice(String deviceId, String mfaAuthToken) → Future<void>
Deletes an MFA device for the authenticated user.
getNewRecoveryCodes() → Future<List<String>>
Generates new recovery codes for the authenticated user.
getRecoveryCodes({bool generateNewCodes = false}) → Future<List<String>>
Gets the recovery codes for the authenticated user.
getUserDevices() → Future<List<MfaDevice>>
Gets all MFA devices associated with the authenticated user.
isMfaRequiredForAction(String mfaAction) → Future<bool>
Checks if MFA is required for a specific action.
isPendingRecoveryCodesAcknowledgment() → Future<bool>
Checks if there are pending recovery codes that need to be acknowledged.
mfaCompletionFailure(Object error) → Future<void>
Emits an MFA completion failure event.
mfaCompletionSuccess({String? mfaToken}) → Future<void>
Emits an MFA completion success event.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onMfaCompletionFailure(void handler(MfaCompletionFailure args)) → StreamSubscription<Message>
Listens for MFA completion failure events from the WebView.
onMfaCompletionSuccess(void handler({String? mfaToken})) → StreamSubscription<Message>
Listens for MFA completion success events from the WebView.
toString() → String
A string representation of this object.
inherited
updateUserDevice(String deviceId) → Future<void>
Updates an MFA device (e.g., changes its alias or default status).
verifyDevice(String code, {String? type}) → Future<MfaDevice>
Verifies an MFA device after it has been added.

Operators

operator ==(Object other) → bool
The equality operator.
inherited