> For the complete documentation index, see [llms.txt](/llms.txt).

# Enable MFA for a user

The `enableMFA` method triggers the MFA setup flow for the signed-in user. It opens a browser where the user sets up their MFA factors.

The method takes optional `LoginParams`. You don't need to pass them for most apps; the SDK uses the current session.

The method returns a `bool` that indicates whether MFA was set up. It throws if MFA is already enabled for the user.

Not available for `idToken` sessions

In v8, `enableMFA` and `manageMFA` throw when the current session was created with `idToken`(custom JWT sign-in such as Firebase), or when you pass `LoginParams` with `idToken`. On Android the error is `ENABLE_MFA_NOT_ALLOWED`; on iOS it's `enabledMfaNotAllowed`. Users who signed in with an OAuth flow, including custom connections configured with `authConnectionConfig` and `ExtraLoginOptions`, can use MFA.

## Usage

Usage

```dart
try {
  final bool isMfaSetup = await Web3AuthFlutter.enableMFA();
} on PlatformException catch (e) {
  log(e.message ?? e.toString());
}

```
