Skip to main content
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. It uses the My Account API’s 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.
User MFA Management component showing available and enrolled verification methods

Supported factors

The component handles every authentication method factor configured with the My Account API.

Configure your application

Select your framework to configure environment variables and universal components.

Setup requirements

Before rendering the UserMFAManagement component, follow Build Account Security UI to configure your Auth0 tenant and applications.

Enable MFA methods and scopes

Enable MFA methods
  1. Navigate to Dashboard > Security > Multi-factor Auth.
  2. Enable the desired factors. To learn more, read Multi-Factor Authentication Factors.
Configure My Account API permissionsConfigure the My Account API User-delegated Access permissions in Build Account Security UI. All five permissions are required for the complete authentication-method management flow.

Install the component

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

  • 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.

Props

Display props

Display props control how the component renders without affecting its behavior.
PropTypeDefaultDescription
hideHeaderbooleanfalseHide the component header (title and description).
readOnlybooleanfalseDisable all mutation actions (enroll and delete). Factors are shown but cannot be added or removed.
showActiveOnlybooleanfalseShow only factor types that the user has at least one active enrollment for. Factor types with no enrollments are hidden.
disableEnrollbooleanfalseHide the enroll button for all factor types. Users can still delete existing factors.
disableDeletebooleanfalseHide the delete button on all enrolled factor rows. Users can still enroll new factors.
factorConfigPartial
<Record<MFAType,
{ visible?: boolean;
enabled?: boolean }>>
{}Per-factor-type visibility and enabled state.
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).

Action props

Action props let you hook into the component’s enrollment and deletion lifecycle events and trigger or cancel operations.
PropTypeDescription
enrollActionComponentAction<MFAType>Lifecycle hooks for factor enrollment. Set disabled: true to disable the enrollment action.
deleteActionComponentAction<MFAType>Lifecycle hooks for factor deletion. Set disabled: true to disable the deletion action.
enrollAction Use onBefore to cancel enrollment before the flow starts. Use onAfter to refresh related UI or send analytics after enrollment completes successfully.
deleteAction Use onBefore to cancel deletion before the built-in confirmation dialog is shown. onAfter runs after a factor is successfully deleted.

Customize props

Customization props let you adapt copy, validation rules, and styling without modifying source code.
PropTypeDescription
customMessagesPartial<UserMfaManagementMessages>Override default UI text and translations.
stylingComponentStyling<UserMFAManagementClasses>CSS variables and class overrides.
schema{ email?: RegExp; phone?: RegExp }Custom validation patterns for email and phone number input fields.
customMessages Customize all text and translations. Every field is optional.
Header header.title, header.description, no_active_mfa, loading_text, component_error.title, component_error.descriptionActions 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_labelPer 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_textNotifications notifications.factor_enroll_success, notifications.factor_remove_success, notifications.fetch_factors_error, notifications.factor_delete_errorEnrollment and removal enrollment and remove_factor_dialog
Customize style Customize appearance with CSS variables and class overrides. Supports light/dark themes.
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
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).

TypeScript definitions

Advanced customization

In addition to the component configuration described above, use the useUserMFA hook when you need to build a custom MFA management interface.
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.
onAfter in enrollAction and deleteAction runs when the success notification closes, rather than immediately when the action completes.

Learn more

User Passkey Management

Manage WebAuthn passkeys with the same lifecycle pattern.

Build a Self-Service Account Security Interface

Overview, prerequisites, and framework setup for all My Account components.