UserMFAMgmt 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 UserMFAMgmt component, you do not need to orchestrate navigation, call API endpoints, or manage state.
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.- React (SPA)
- Next.js (RWA)
- shadcn
Setup requirements
Before rendering theUserMFAMgmt component, follow Build Account Security UI to configure your Auth0 tenant and applications.Enable MFA methods and scopes
Enable MFA methods- Navigato to Dashboard > Security > Multi-factor Auth.
- Enable the desired factors. To learn more, read Multi-Factor Authentication Factors.
enroll:authencicatorsremove:authenticators
Install the component
The install command also adds 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
Auth0ComponentProvidercomponent uses a framework-specific subpath:/spafor React applications,/rwafor Next.js applications.
Full integration example
Full integration example
Props
Display props
Display props control how the component renders without affecting its behavior.| Prop | Type | Default | Description |
|---|---|---|---|
hideHeader | boolean | false | Hide the component header (title and description). |
readOnly | boolean | false | Disable all mutation actions (enroll and delete). Factors are shown but cannot be added or removed. |
showActiveOnly | boolean | false | Show only factor types that the user has at least one active enrollment for. Factor types with no enrollments are hidden. |
disableEnroll | boolean | false | Hide the enroll button for all factor types. Users can still delete existing factors. |
disableDelete | boolean | false | Hide the delete button on all enrolled factor rows. Users can still enroll new factors. |
factorConfig | Partial | {} | Per-factor-type visibility and enabled state. |
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: sms, otp, email, push-notification, webauthn-platform, webauthn-roaming, recovery-code.
visiblerender the factor row in the list (falseto hide).enabledrender the factor row is interactive (falserenders it greyed-out and non-interactive).
Action props
Action props let you hook into the component’s lifecycle events and trigger or cancel operations.| Prop | Type | Description |
|---|---|---|
onEnroll | () => void | Triggered after a factor is successfully enrolled. |
onDelete | () => void | Triggered after a factor is successfully deleted. |
onFetch | () => void | Triggered after the user’s factors are successfully loaded. |
onErrorAction | (error: Error, action: ‘enroll’ | | Triggered when any action fails. Use this to surface errors to logs or logging system. |
onBeforeAction | (action: ‘enroll’ | ‘delete’ | ‘confirm’, | Triggered before an action executes. Return false (or a Promise resolving to false) to cancel. |
action parameter identifies which stage errored: 'enroll' (initiating enrollment), 'confirm' (submitting the OTP or QR code), or 'delete'.
false or a Promise that resolves to false to cancel the operation. The factorType parameter identifies which factor type is involved.
'delete'triggers before the built-in confirmation dialog is shown. Returnfalseto cancel the deletion without ever showing the dialog.'enroll'/'confirm'use this for pre-flight checks (for example, rate limiting, policy checks).
Customize props
Customization props let you adapt copy, validation rules, and styling without modifying source code.| Prop | Type | Description |
|---|---|---|
customMessages | Partial<MFAMessages> | Override default UI text and translations. |
styling | ComponentStyling<UserMFAMgmtClasses> | CSS variables and class overrides. |
schema | { email?: RegExp; phone?: RegExp } | Custom validation patterns for email and phone number input fields. |
Available Messages
Available Messages
Top-level
title, description, enabled (badge label on enrolled factors), no_active_mfa (empty state when showActiveOnly is true)Actions enroll (enroll button label), delete (delete button label), enroll_factor (success message), remove_factor (success message), deleting (in-progress label), cancelDelete confirmation delete_mfa_title, delete_mfa_contentPer factor type (replace {factor} with sms, otp, email, push-notification, webauthn-platform, webauthn-roaming, recovery-code) {factor}.title, {factor}.description, {factor}.button-textErrors errors.factors_loading_error, errors.delete_factor, errors.failedAvailable Styling Options
Available Styling Options
Variables—CSS custom properties
commonApplied to both themeslightLight mode onlydarkDark mode only
UserMFAMgmt-cardthe outer card wrapping the factor listUserMFASetupForm-dialogContentthe enrollment multi-step dialog content areaDeleteFactorConfirmation-dialogContentthe delete confirmation dialog content area
emailvalidates the email address entered during email-OTP enrollment (default: standard RFC-5322-style pattern).phonevalidates the phone number entered during SMS enrollment (default: accepts international E.164 format).
TypeScript definitions
Advanced customization
TheUserMFAMgmt component is composed of a stateless view component and a hook. Import them individually to build custom workflows.
Available subcomponents
For advanced use cases, you can import individual subcomponents to build custom interfaces.| Subcomponent | Description |
|---|---|
UserMFAMgmtView | Stateless view layer; bring your own data and handlers via useUserMFA. |
| Shared sub-components | Description |
|---|---|
UserMFASetupForm | Multi-step enrollment dialog. Handles the full enrollment flow: contact entry (phone/email), OTP verification, QR-code scanning (for TOTP and push), and recovery-code display. |
DeleteFactorConfirmation | Confirmation dialog shown before a factor is deleted. |
FactorsList | Renders the list of active enrollments within a factor-type row, with per-enrollment delete buttons. |
Available hooks
| Hook | Description |
|---|---|
useUserMFA | Full data and interaction layer: factor query, enrollment mutation, delete mutation, OTP confirmation, dialog state, and all event handlers. |
Learn more
UserPasskeyMgmt
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.