> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# User MFA Management

> Learn how to render a card-based UI that lets users enroll, view, and delete their own multi-factor authentication factors using the My Account API.

> [!WARNING]
>
> **The Auth0 Universal Components feature is in [Beta](/docs/docs/troubleshoot/product-lifecycle/product-release-stages).**
>
> To participate, contact Auth0 Support.
>
> By using this feature, you agree to the applicable Free Trial terms in Okta's [Master Subscription Agreement](https://www.okta.com/legal).

The `UserMFAManagement` component lets users enroll, view, and delete their own multi-factor authentication factors in a single card-based interface using the [My Account API](/docs/docs/manage-users/my-account-api).

It uses the My Account API’s [authentication methods](/docs/docs/manage-users/my-account-api#manage-authentication-methods) management capabilities to render a complete UI for managing a user’s authentication methods.

With the `UserMFAManagement` component, you do not need to orchestrate navigation, call API endpoints, or manage [state](/docs/docs/api/authentication/authorization-code-flow/authorize-application#param-state).

![User MFA Management component showing available and enrolled verification methods](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/universal-components/my-account/web/user-mfa-management-light.png)

## Supported factors

The component handles every [authentication method factor](/docs/docs/secure/multi-factor-authentication/multi-factor-authentication-factors) configured with the My Account API.

| **Factor** | **What the component renders** |
| - | - |
| Email OTP | Email input → 6-digit OTP verification |
| SMS OTP | Country-code picker + phone entry → 6-digit OTP verification |
| TOTP (Authenticator application) | QR code with manual-entry key → 6-digit OTP verification |
| Push notifications scan → "waiting for approval" state | |
| Passkeys | Educational screen → OS biometric prompt → enrolled entry in the list |
| Recovery codes | Display-once code list with a copy action and an "I've saved my codes" confirmation |

## Configure your application

Select your framework to configure environment variables and universal components.

> [tab] React (SPA)
>
> ## Setup requirements
>
> Before rendering the `UserMFAManagement` component, follow [Build Account Security UI](/docs/docs/get-started/universal-components/web/components/my-account-overview) to configure your Auth0 tenant and applications.
>
> ### Enable MFA methods and scopes
>
> **Enable MFA methods**
>
> 1. Navigate to [**Dashboard > Security > Multi-factor Auth**](https://manage.auth0.com/dashboard/#/security/mfa).
> 2. Enable the desired factors. To learn more, read [Multi-Factor Authentication Factors](/docs/docs/secure/multi-factor-authentication/multi-factor-authentication-factors#multi-factor-authentication-factors).
>
> **Configure My Account API permissions**
>
> Configure the My Account API User-delegated Access permissions in [Build Account Security UI](/docs/docs/get-started/universal-components/web/components/my-account-overview#create-the-application-and-configure-my-account-api-permissions). All five permissions are required for the complete authentication-method management flow.
>
> ## Install the component
>
> ```bash pnpm wrap lines theme={null}
> pnpm add @auth0/universal-components-react react-hook-form @tanstack/react-query
> ```
>
> ```bash npm wrap lines theme={null}
> npm install @auth0/universal-components-react react-hook-form @tanstack/react-query
> ```
>
> `react-hook-form` and `@tanstack/react-query` are peer dependencies. The command also installs the `@auth0/universal-components-core` dependency for shared utilities and Auth0 integration.
>
> ## Get started
>
> ```tsx wrap lines theme={null}
> import { UserMFAManagement } from "@auth0/universal-components-react";
>
> export function SecurityPage() {
>   return <UserMFAManagement />;
> }
> ```
>
> * Components are always imported from the root entry `@auth0/universal-components-react`, regardless of framework.
>
> * Only the `Auth0ComponentProvider` component uses a framework-specific subpath: `/spa` for React applications, `/rwa` for Next.js applications.
>
> > [accordion] Full integration example
> >
> > ```tsx wrap lines theme={null}
> > import React from "react";
> > import { UserMFAManagement } from "@auth0/universal-components-react";
> > import { Auth0Provider } from "@auth0/auth0-react";
> > import { Auth0ComponentProvider } from "@auth0/universal-components-react/spa";
> > import { analytics } from "./lib/analytics";
> >
> > function SecurityPage() {
> >   return (
> >     <div className="max-w-3xl mx-auto p-6">
> >       <UserMFAManagement
> >         factorConfig={{
> >           phone: { visible: true, enabled: true },
> >           totp: { visible: true, enabled: true },
> >           "push-notification": { visible: true, enabled: true },
> >           email: { visible: true, enabled: true },
> >           "recovery-code": { visible: true, enabled: true },
> >           "webauthn-platform": { visible: false },
> >           "webauthn-roaming": { visible: false },
> >         }}
> >         enrollAction={{
> >           onAfter: (factor) => {
> >             analytics.track("MFA Factor Enrolled", { factor });
> >           },
> >         }}
> >         deleteAction={{
> >           onBefore: (factor) => window.confirm(`Remove your ${factor} authenticator?`),
> >           onAfter: (factor) => {
> >             analytics.track("MFA Factor Deleted", { factor });
> >           },
> >         }}
> >         customMessages={{
> >           header: {
> >             title: "Two-Factor Authentication",
> >             description: "Manage the extra verification methods used to protect your account.",
> >           },
> >         }}
> >         styling={{
> >           variables: {
> >             light: { "--color-primary": "#4f46e5" },
> >             dark: { "--color-primary": "#818cf8" },
> >           },
> >         }}
> >       />
> >     </div>
> >   );
> > }
> >
> > export default function App() {
> >   const domain = "YOUR_TENANT_DOMAIN.auth0.com";
> >   const clientId = "YOUR_CLIENT_ID";
> >
> >   return (
> >     <Auth0Provider
> >       domain={domain}
> >       clientId={clientId}
> >       authorizationParams={{ redirect_uri: window.location.origin }}
> >       interactiveErrorHandler="popup"
> >     >
> >       <Auth0ComponentProvider>
> >         <SecurityPage />
> >       </Auth0ComponentProvider>
> >     </Auth0Provider>
> >   );
> > }
> > ```

> [tab] Next.js (RWA)
>
> ## Setup requirements
>
> Before rendering the `UserMFAManagement` component, follow [Build Account Security UI](/docs/docs/get-started/universal-components/web/components/my-account-overview) to configure your Auth0 tenant and applications.
>
> ### Enable MFA methods and scopes
>
> **Enable MFA methods**
>
> 1. Navigate to [**Dashboard > Security > Multi-factor Auth**](https://manage.auth0.com/dashboard/#/security/mfa).
> 2. Enable the desired factors. To learn more, read [Multi-Factor Authentication Factors](/docs/docs/secure/multi-factor-authentication/multi-factor-authentication-factors#multi-factor-authentication-factors).
>
> **Configure My Account API permissions**
>
> Configure the My Account API User-delegated Access permissions in [Build Account Security UI](/docs/docs/get-started/universal-components/web/components/my-account-overview#create-the-application-and-configure-my-account-api-permissions). All five permissions are required for the complete authentication-method management flow.
>
> ## Install the component
>
> ```bash pnpm wrap lines theme={null}
> pnpm add @auth0/universal-components-react react-hook-form @tanstack/react-query
> ```
>
> ```bash npm wrap lines theme={null}
> npm install @auth0/universal-components-react react-hook-form @tanstack/react-query
> ```
>
> `react-hook-form` and `@tanstack/react-query` are peer dependencies. The command also installs the `@auth0/universal-components-core` dependency for shared utilities and Auth0 integration.
>
> ## Get started
>
> ```tsx app/security/page.tsx wrap lines theme={null}
> "use client";
>
> import { UserMFAManagement } from "@auth0/universal-components-react";
>
> export default function SecurityPage() {
>   return <UserMFAManagement />;
> }
> ```
>
> > [accordion] Full integration example
> >
> > ```tsx app/security/page.tsx wrap lines theme={null}
> > "use client";
> >
> > import { UserMFAManagement } from "@auth0/universal-components-react";
> > import { analytics } from "@/lib/analytics";
> >
> > export default function SecurityPage() {
> >   return (
> >     <div className="max-w-3xl mx-auto p-6">
> >       <UserMFAManagement
> >         factorConfig={{
> >           phone: { visible: true, enabled: true },
> >           totp: { visible: true, enabled: true },
> >           "push-notification": { visible: true, enabled: true },
> >           email: { visible: true, enabled: true },
> >           "recovery-code": { visible: true, enabled: true },
> >           "webauthn-platform": { visible: false },
> >           "webauthn-roaming": { visible: false },
> >         }}
> >         enrollAction={{
> >           onAfter: (factor) => {
> >             analytics.track("MFA Factor Enrolled", { factor });
> >           },
> >         }}
> >         deleteAction={{
> >           onAfter: (factor) => {
> >             analytics.track("MFA Factor Deleted", { factor });
> >           },
> >         }}
> >         customMessages={{
> >           header: { title: "Two-Factor Authentication" },
> >         }}
> >         styling={{
> >           variables: {
> >             light: { "--color-primary": "#4f46e5" },
> >             dark: { "--color-primary": "#818cf8" },
> >           },
> >         }}
> >       />
> >     </div>
> >   );
> > }
> > ```

> [tab] shadcn
>
> ## Setup requirements
>
> Before rendering the `UserMFAManagement` component, follow [Build Account Security UI](/docs/docs/get-started/universal-components/web/components/my-account-overview) to configure your Auth0 tenant and applications.
>
> ### Enable MFA methods and scopes
>
> **Enable MFA methods**
>
> 1. Navigate to [**Dashboard > Security > Multi-factor Auth**](https://manage.auth0.com/dashboard/#/security/mfa).
> 2. Enable the desired factors. To learn more, read [Multi-Factor Authentication Factors](/docs/docs/secure/multi-factor-authentication/multi-factor-authentication-factors#multi-factor-authentication-factors).
>
> **Configure My Account API permissions**
>
> Configure the My Account API User-delegated Access permissions in [Build Account Security UI](/docs/docs/get-started/universal-components/web/components/my-account-overview#create-the-application-and-configure-my-account-api-permissions). All five permissions are required for the complete authentication-method management flow.
>
> ## Install the component
>
> ```bash wrap lines theme={null}
> npx shadcn@latest add auth0/auth0-ui-components/react/my-account/user-mfa-management
> ```
>
> The install command adds the component source into `src/components/auth0/my-account/` along with all UI dependencies and the `@auth0/universal-components-core` dependency for shared utilities and Auth0 integration.
>
> **Legacy Vercel registry retired**: The Vercel-hosted registry
> (`https://auth0-universal-components.vercel.app/r/...`) was retired on
> **September 17, 2026**. Use the GitHub Registry path above.
>
> ## Get started
>
> ```tsx wrap lines theme={null}
> import { UserMFAManagement } from "@/components/auth0/my-account/user-mfa-management";
>
> export function SecurityPage() {
>   return <UserMFAManagement />;
> }
> ```
>
> > [accordion] Full integration example
> >
> > ```tsx wrap lines theme={null}
> > import React from "react";
> > import { UserMFAManagement } from "@/components/auth0/my-account/user-mfa-management";
> > import { Auth0Provider } from "@auth0/auth0-react";
> > import { Auth0ComponentProvider } from "@auth0/universal-components-react/spa";
> > import { analytics } from "./lib/analytics";
> >
> > function SecurityPage() {
> >   return (
> >     <div className="max-w-3xl mx-auto p-6">
> >       <UserMFAManagement
> >         factorConfig={{
> >           phone: { visible: true, enabled: true },
> >           totp: { visible: true, enabled: true },
> >           "push-notification": { visible: true, enabled: true },
> >           email: { visible: true, enabled: true },
> >           "recovery-code": { visible: true, enabled: true },
> >           "webauthn-platform": { visible: false },
> >           "webauthn-roaming": { visible: false },
> >         }}
> >         enrollAction={{
> >           onAfter: (factor) => {
> >             analytics.track("MFA Factor Enrolled", { factor });
> >           },
> >         }}
> >         deleteAction={{
> >           onBefore: (factor) => window.confirm(`Remove your ${factor} authenticator?`),
> >           onAfter: (factor) => {
> >             analytics.track("MFA Factor Deleted", { factor });
> >           },
> >         }}
> >         customMessages={{
> >           header: { title: "Two-Factor Authentication" },
> >         }}
> >         styling={{
> >           variables: {
> >             light: { "--color-primary": "#4f46e5" },
> >             dark: { "--color-primary": "#818cf8" },
> >           },
> >         }}
> >       />
> >     </div>
> >   );
> > }
> >
> > export default function App() {
> >   const domain = "YOUR_TENANT_DOMAIN.auth0.com";
> >   const clientId = "YOUR_CLIENT_ID";
> >
> >   return (
> >     <Auth0Provider
> >       domain={domain}
> >       clientId={clientId}
> >       authorizationParams={{ redirect_uri: window.location.origin }}
> >       interactiveErrorHandler="popup"
> >     >
> >       <Auth0ComponentProvider>
> >         <SecurityPage />
> >       </Auth0ComponentProvider>
> >     </Auth0Provider>
> >   );
> > }
> > ```

## Props

### Display props

Display props control how the component renders without affecting its behavior.

<table>
  <thead>
    <tr>
      <th>Prop</th>
      <th>Type</th>
      <th>Default</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`hideHeader`</td>
      <td>`boolean`</td>
      <td>`false`</td>
      <td>Hide the component header (title and description).</td>
    </tr>

    <tr>
      <td>`readOnly`</td>
      <td>`boolean`</td>
      <td>`false`</td>
      <td>Disable all mutation actions (enroll and delete). Factors are shown but cannot be added or removed.</td>
    </tr>

    <tr>
      <td>`showActiveOnly`</td>
      <td>`boolean`</td>
      <td>`false`</td>
      <td>Show only factor types that the user has at least one active enrollment for. Factor types with no enrollments are hidden.</td>
    </tr>

    <tr>
      <td>`disableEnroll`</td>
      <td>`boolean`</td>
      <td>`false`</td>
      <td>Hide the enroll button for all factor types. Users can still delete existing factors.</td>
    </tr>

    <tr>
      <td>`disableDelete`</td>
      <td>`boolean`</td>
      <td>`false`</td>
      <td>Hide the delete button on all enrolled factor rows. Users can still enroll new factors.</td>
    </tr>

    <tr>
      <td>`factorConfig`</td>
      <td>`Partial<Record<MFAType,{ visible?: boolean; enabled?: boolean }>>`</td>
      <td>`{}`</td>
      <td>Per-factor-type visibility and enabled state.</td>
    </tr>
  </tbody>
</table>

**factorConfig**

Use `factorConfig` to show or grey-out specific factor types without editing the tenant configuration.
Each key is a factor type `string`; both fields are optional and default to `true`.

Supported factor type keys: `phone`, `totp`, `email`, `push-notification`, `webauthn-platform`, `webauthn-roaming`, `recovery-code`.

* `visible` renders the factor row in the list (`false` to hide).
* `enabled` renders the factor row is interactive (`false` renders it greyed-out and non-interactive).

```tsx wrap lines theme={null}
<UserMFAManagement
  factorConfig={{
    phone: { visible: true, enabled: true },
    totp: { visible: true, enabled: true },
    email: { visible: true, enabled: false }, // shown but greyed-out
    "webauthn-platform": { visible: false },  // hidden entirely
  }}
/>
```

### Action props

Action props let you hook into the component's enrollment and deletion lifecycle events and trigger or cancel operations.

<table>
  <thead>
    <tr>
      <th>Prop</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`enrollAction`</td>
      <td>`ComponentAction<MFAType>`</td>
      <td>Lifecycle hooks for factor enrollment. Set `disabled: true` to disable the enrollment action.</td>
    </tr>

    <tr>
      <td>`deleteAction`</td>
      <td>`ComponentAction<MFAType>`</td>
      <td>Lifecycle hooks for factor deletion. Set `disabled: true` to disable the deletion action.</td>
    </tr>
  </tbody>
</table>

**enrollAction**

Use `onBefore` to cancel enrollment before the flow starts. Use `onAfter` to refresh related UI or send analytics after enrollment completes successfully.

```tsx wrap lines theme={null}
<UserMFAManagement
  enrollAction={{
    onBefore: (factor) => window.confirm(`Enroll ${factor}?`),
    onAfter: (factor) => {
      analytics.track("MFA Factor Enrolled", { factor });
    },
  }}
/>
```

**deleteAction**

Use `onBefore` to cancel deletion before the built-in confirmation dialog is shown. `onAfter` runs after a factor is successfully deleted.

```tsx wrap lines theme={null}
<UserMFAManagement
  deleteAction={{
    onBefore: (factor) =>
      window.confirm(`Remove your ${factor} authenticator? You may be locked out if this is your only factor.`),
    onAfter: (factor) => {
      analytics.track("MFA Factor Deleted", { factor });
    },
  }}
/>
```

### Customize props

Customization props let you adapt copy, validation rules, and styling without modifying source code.

<table>
  <thead>
    <tr>
      <th>Prop</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`customMessages`</td>
      <td>`Partial<UserMfaManagementMessages>`</td>
      <td>Override default UI text and translations.</td>
    </tr>

    <tr>
      <td>`styling`</td>
      <td>`ComponentStyling<UserMFAManagementClasses>`</td>
      <td>CSS variables and class overrides.</td>
    </tr>

    <tr>
      <td>`schema`</td>
      <td>`{ email?: RegExp; phone?: RegExp }`</td>
      <td>Custom validation patterns for email and phone number input fields.</td>
    </tr>
  </tbody>
</table>

**customMessages**

Customize all text and translations. Every field is optional.

> [accordion] Available Messages
>
> **Header** `header.title`, `header.description`, `no_active_mfa`, `loading_text`, `component_error.title`, `component_error.description`
>
> **Actions** `actions.remove_button_label`, `actions.cancel_button_label`, `actions.confirm_button_label`, `actions.continue_button_label`, `actions.submit_button_label`, `actions.verify_button_label`, `actions.back_button_label`, `actions.deleting_button_text`, `actions.menu_aria_label`
>
> **Per factor type** (replace `{factor}` with `phone`, `totp`, `email`, `push-notification`, `webauthn-platform`, `webauthn-roaming`, or `recovery-code`) `factors.{factor}.title`, `factors.{factor}.description`, `factors.{factor}.button_text`
>
> **Notifications** `notifications.factor_enroll_success`, `notifications.factor_remove_success`, `notifications.fetch_factors_error`, `notifications.factor_delete_error`
>
> **Enrollment and removal** `enrollment` and `remove_factor_dialog`

```tsx wrap lines theme={null}
<UserMFAManagement
  customMessages={{
    header: {
      title: "Two-Factor Authentication",
      description: "Add extra layers of security to protect your account.",
    },
    no_active_mfa: "You haven't enrolled any authentication methods yet.",
    factors: {
      phone: {
        title: "Text message (SMS)",
        description: "Receive a one-time code via text message.",
        button_text: "Add method",
      },
      totp: {
        title: "Authenticator app",
        description: "Use Google Authenticator, Authy, or any TOTP app.",
      },
    },
    notifications: {
      fetch_factors_error: "Unable to load your security methods.",
    },
  }}
/>
```

**Customize style**

Customize appearance with CSS variables and class overrides. Supports light/dark themes.

> [accordion] Available Styling Options
>
> **Variables**—CSS custom properties
>
> * `common` Applied to both themes
> * `light` Light mode only
> * `dark` Dark mode only
>
> **Class overrides**
>
> * `UserMFAManagement-item` each factor-type card container
> * `EnrollFactorModal-dialogContent` the enrollment multi-step dialog content area
> * `FactorDeleteModal-dialogContent` the delete confirmation dialog content area

```tsx wrap lines theme={null}
<UserMFAManagement
  styling={{
    variables: {
      light: { "--color-primary": "#4f46e5" },
      dark: { "--color-primary": "#818cf8" },
    },
    classes: {
      "UserMFAManagement-item": "rounded-2xl shadow-md border-2",
      "EnrollFactorModal-dialogContent": "max-w-lg",
      "FactorDeleteModal-dialogContent": "max-w-sm",
    },
  }}
/>
```

**schema**

Override the built-in regex patterns used to validate user input during enrollment. Both fields are optional; unset fields keep their default patterns.

* `email` validates the email address entered during email-OTP enrollment (default: standard RFC-5322-style pattern).
* `phone` validates the phone number entered during SMS enrollment (default: accepts international E.164 format).

```tsx wrap lines theme={null}
<UserMFAManagement
  schema={{
    // Restrict to company domain only
    email: /^[a-zA-Z0-9._%+-]+@example\.com$/,
    // US numbers only
    phone: /^\+1[2-9]\d{2}[2-9]\d{6}$/,
  }}
/>
```

## TypeScript definitions

```typescript wrap lines theme={null}
type MFAType =
  | "phone"
  | "totp"
  | "email"
  | "push-notification"
  | "webauthn-platform"
  | "webauthn-roaming"
  | "recovery-code";

interface FactorConfigOptions {
  visible?: boolean;
  enabled?: boolean;
}

interface UserMFAManagementClasses {
  "UserMFAManagement-item"?: string;
  "EnrollFactorModal-dialogContent"?: string;
  "FactorDeleteModal-dialogContent"?: string;
}

interface ComponentAction<Item, Context = void> {
  disabled?: boolean;
  onBefore?: (item: Item, context?: Context) => boolean;
  onAfter?: (item: Item, context?: Context) => void | boolean | Promise<boolean>;
}

interface UserMFAManagementProps {
  hideHeader?: boolean;
  showActiveOnly?: boolean;
  disableEnroll?: boolean;
  disableDelete?: boolean;
  readOnly?: boolean;
  factorConfig?: Partial<Record<MFAType, FactorConfigOptions>>;
  customMessages?: Partial<UserMfaManagementMessages>;
  styling?: ComponentStyling<UserMFAManagementClasses>;
  schema?: { email?: RegExp; phone?: RegExp };
  enrollAction?: ComponentAction<MFAType>;
  deleteAction?: ComponentAction<MFAType>;
}
```

## Advanced customization

In addition to the component configuration described above, use the `useUserMFA` hook when you need to build a custom MFA management interface.

```tsx wrap lines theme={null}
import { useUserMFA } from "@auth0/universal-components-react";

export function CustomMfaManagement() {
  const {
    factorsByType,
    isLoadingFactors,
    error,
    visibleFactorTypes,
    handleEnroll,
    handleDeleteFactor,
  } = useUserMFA({
    factorConfig: {
      phone: { visible: true, enabled: true },
      totp: { visible: true, enabled: true },
    },
  });

  if (isLoadingFactors) return <p>Loading authentication methods…</p>;
  if (error) return <p role="alert">{error}</p>;

  return (
    <ul>
      {visibleFactorTypes.map((factorType) => (
        <li key={factorType}>
          <button onClick={() => handleEnroll(factorType)}>
            Add {factorType}
          </button>
          {factorsByType[factorType]?.map((factor) => (
            <button
              key={factor.id}
              onClick={() => handleDeleteFactor(factor.id, factorType)}
            >
              Remove {factorType}
            </button>
          ))}
        </li>
      ))}
    </ul>
  );
}
```

The hook accepts `showActiveOnly`, `readOnly`, `disableDelete`, `factorConfig`, `customMessages`, `enrollAction`, and `deleteAction`. It returns factor data, loading and action state, enrollment and deletion state, and the handlers required to implement enrollment, verification, and removal flows.

Use `UserMFAManagement` when you want the built-in interface. If you use the hook, implement the matching enrollment, verification, recovery-code, and deletion UI for the factor types you support.

> [!NOTE]
>
> `onAfter` in `enrollAction` and `deleteAction` runs when the success notification closes, rather than immediately when the action completes.

## Learn more

> [card] [User Passkey Management](/docs/docs/get-started/universal-components/web/components/user-passkey-management)
>
> Manage WebAuthn passkeys with the same lifecycle pattern.

> [card] [Build a Self-Service Account Security Interface](/docs/docs/get-started/universal-components/web/components/my-account-overview)
>
> Overview, prerequisites, and framework setup for all My Account components.
