# Question About Implementing Custom MFA Settings Page in Auth0

**URL:** <https://community.auth0.com/t/question-about-implementing-custom-mfa-settings-page-in-auth0/183588>\
**Category:** Get Help\
**Tags:** mfa-api, mfa\
**Created:** [March 9, 2025, 5:43pm UTC](https://community.auth0.com/t/question-about-implementing-custom-mfa-settings-page-in-auth0/183588 "2025-03-09T17:43:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinzhao](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kevinzhao/32/71757_2.png) [@kevinzhao](https://community.auth0.com/u/kevinzhao)\
**Post date:** [March 9, 2025, 5:43pm UTC](https://community.auth0.com/t/question-about-implementing-custom-mfa-settings-page-in-auth0/183588/1 "2025-03-09T17:43:38Z")

</div>

Hi all,  
I’m trying to implement a custom MFA settings page and have encountered some logical challenges that I’d appreciate guidance on.

## Background

Our application uses Auth0’s passwordless authentication for user login (via the @auth0/auth0-react library’s loginWithRedirect and Universal Login). Now I want to add a custom page where users can enroll and manage their MFA methods.

## The Challenge

According to the [Auth0 documentation](https://auth0.com/docs/secure/multi-factor-authentication/authenticate-using-ropg-flow-with-mfa), enrolling MFA requires first obtaining an MFA token, then using that token to call the /mfa/associate endpoint.

The standard method for obtaining an MFA token is through the Resource Owner Password Flow (ROPG), which involves calling the /oauth/token endpoint with a username and password. However, since we’re using passwordless login, we can’t use this approach to get an MFA token.

## Solution I’ve Tried

I’ve attempted to obtain an MFA token using:

```auto
loginWithRedirect({
  authorizationParams: {
    audience: "https://AUTH0_DOMAIN/mfa/",
    scope: "read:authenticators remove:authenticators enroll",
  }
})

```

And then using:

```auto
getAccessTokenSilently({
  audience: "https://AUTH0_DOMAIN/mfa/",
  scope: "read:authenticators remove:authenticators enroll",
})

```

## The Issue

When I call the loginWithRedirect method above, Auth0 automatically forces the user to complete the MFA registration flow. This contradicts my intention because:

- I originally wanted users to select and enroll MFA methods through our custom interface

- I need to first obtain an MFA token, then call the /mfa/associate endpoint to enroll MFA

1. But during the process of obtaining the MFA token, the user is already forced to complete MFA enrollment flow

## My Questions

- When using passwordless authentication, is there another way to obtain an MFA token without forcing users to immediately complete MFA setup?

- Is there a better approach to implement a custom MFA settings page that allows users to choose when and which method to add for MFA?

I look forward to your suggestions and guidance. Thank you!

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 10, 2025, 7:54pm UTC](https://community.auth0.com/t/question-about-implementing-custom-mfa-settings-page-in-auth0/183588/3 "2025-03-10T19:54:20Z")

</div>

Hi @kevinzhao,

Thanks for your question.

> [@kevinzhao](#):
>
> When using passwordless authentication, is there another way to obtain an MFA token without forcing users to immediately complete MFA setup?

According to [this documentation](https://auth0.com/docs/secure/multi-factor-authentication/manage-mfa-auth0-apis/manage-authenticator-factors-mfa-api#universal-login:~:text=When%20https%3A//onboarding%2Dtiow.us.auth0.com/mfa/%20is%20specified%20as%20the%20audience%2C%20MFA%20is%20enforced.) it mentions that when `https://AUTH0_DOMAIN/mfa/` is specified as the audience, MFA is enforced. This means that completing MFA is unavoidable.

I would add that the user can still select and enroll in whichever MFA methods you have configured on the Universal Login by clicking the **Try another method** option.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/7/3/73fbffc242755ab15eb52a299376628ad16da7f9.png)

As for a custom MFA interface to allow your users to accomplish the same behavior, the user must complete the required MFA prompt to get an MFA access token to call any endpoints in the MFA API.

> [@kevinzhao](#):
>
> Is there a better approach to implement a custom MFA settings page that allows users to choose when and which method to add for MFA?

There is an option to use a post-login action to first redirect your users to a custom page to let them decide whether to skip or proceed with MFA. After the authentication resumes, you can save their preference from their selection and enforce or skip MFA.

There is the [`api.authentication.challengeWithAny(factors)`](https://auth0.com/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-api-object#:~:text=api.authentication.challengeWithAny(factors)) method in a post-login action to prompt users with an MFA picker to select their preferred MFA method on the Universal Login.

This way, you can continue to leverage the Universal Login UI for the MFA picker.

Let me know if you have any questions about this.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![kevinzhao](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kevinzhao/32/71757_2.png) [@kevinzhao](https://community.auth0.com/u/kevinzhao)\
**Post date:** [March 11, 2025, 6:18am UTC](https://community.auth0.com/t/question-about-implementing-custom-mfa-settings-page-in-auth0/183588/4 "2025-03-11T06:18:50Z")

</div>

Thanks for your response. This is very helpful.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [March 11, 2025, 3:15pm UTC](https://community.auth0.com/t/question-about-implementing-custom-mfa-settings-page-in-auth0/183588/5 "2025-03-11T15:15:51Z")

</div>

Hi @kevinzhao,

Of course! I’m glad that this was helpful.

If you have any questions or need help with its implementation, let us know.

Cheers,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 25, 2025, 3:16pm UTC](https://community.auth0.com/t/question-about-implementing-custom-mfa-settings-page-in-auth0/183588/6 "2025-03-25T15:16:29Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
