# How to implement MFA step-up when using Auth0.js SDK for authentication

**URL:** <https://community.auth0.com/t/how-to-implement-mfa-step-up-when-using-auth0-js-sdk-for-authentication/27722>\
**Category:** Get Help\
**Tags:** react, auth0js, mfa-sms, mfa\
**Created:** [July 10, 2019, 9:21am UTC](https://community.auth0.com/t/how-to-implement-mfa-step-up-when-using-auth0-js-sdk-for-authentication/27722 "2019-07-10T09:21:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![daanporon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daanporon/32/13703_2.png) [@daanporon](https://community.auth0.com/u/daanporon)\
**Post date:** [July 10, 2019, 9:21am UTC](https://community.auth0.com/t/how-to-implement-mfa-step-up-when-using-auth0-js-sdk-for-authentication/27722/1 "2019-07-10T09:21:06Z")

</div>

Hi,  
We integrated a standard login procedure using Username-Password-Authentication via the auth0.js library (version 9.19.4) in our React application. Now for certain calls on our api we need to step up our authentication, to access those api’s. We would like to use the MFA using SMS for this. How should we integrate this? Couldn’t find any existing examples for this.

**My thoughts:**

- I think i need to request an updated idToken (with extra scopes) via the MFA api’s ([Authentication API - Auth0 Docs](https://auth0.com/docs/api/authentication#multi-factor-authentication))? But i’m not sure how i should obtain the mfa\_token in this case. When i have an updated idToken i can pass this on to the api and they can check the scopes for this idToken.
- will the renewAuth() or the authorize() with an updated scope automatically trigger the MFA?

Any help, examples would be welcome.

Kind regards,  
Daan

---

<div class="post-metadata">

**Author:** ![daanporon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daanporon/32/13703_2.png) [@daanporon](https://community.auth0.com/u/daanporon)\
**Post date:** [September 17, 2019, 3:42pm UTC](https://community.auth0.com/t/how-to-implement-mfa-step-up-when-using-auth0-js-sdk-for-authentication/27722/2 "2019-09-17T15:42:29Z")

</div>

We are still having issues with this …

FYI: we are using an embedded login implementation using the auth0.js SDK. Using the universal login is not an option for us. We where using the implicit flow, but already refactored this to the **Code authorization flow** to test the following:

- We created a rule that checks if a certain extra scope is asked for then it triggers the MFA error.
- After that we tried to trigger this rule in our application
  - by doing a **silent authentication using checkSession** with the extra scope as a parameter. But this doesn’t work, we get a login\_required error with description ‘Multi factor authentication is required’ in stead of a mfa\_required error. The **login\_required error doesn’t have a mfa\_token** we can use to start the MFA flow
  - after that we enabled the **refresh\_token** because we saw that the oauth/token call does trigger the mfa\_required error (however we don’t think the refresh token is a good solution, we just wanted to check if this could work). And when refreshing the token with adding the scope in the body (which isn’t a known property) the rule is triggered and **we get our mfa\_required error with the mfa\_token**. And we can use this token to complete the MFA flow, but the token we get at the end **doesn’t include our extra scope and we don’t have the AMR or ACR property in our id token** as is described here ([Configure Step-up Authentication for Web Apps](https://auth0.com/docs/multifactor-authentication/step-up-authentication/step-up-for-web-apps#sample-payloads)). Probably because the refresh token grant doesn’t take the scope parameter into account.

Any idea what the best solution is to do a step-up authentication using the embedded screens (as well the login, as the screen to enter the OOB code)?

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [September 18, 2019, 6:19pm UTC](https://community.auth0.com/t/how-to-implement-mfa-step-up-when-using-auth0-js-sdk-for-authentication/27722/3 "2019-09-18T18:19:52Z")

</div>

Hey there @daanporon, I wanted to reach out and let you know I am looking into this and will relay what I find. Thanks!

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [September 19, 2019, 5:13pm UTC](https://community.auth0.com/t/how-to-implement-mfa-step-up-when-using-auth0-js-sdk-for-authentication/27722/4 "2019-09-19T17:13:45Z")

</div>

Following up on this @daanporon after checking with a senior engineer for clarity, I was able to confirm that the workflow you are pursuing is not successfully possible at this time. Since you are looking to leverage an embedded workflow the session isn’t directly established with Auth0. Since the session isn’t established in Auth0, silent authentication will always result in a failure.

You are seeing the `mfa_required` as a result of the silent authentication throwing an error directly associated with that, MFA being required. As the silent authentication is a non-interactive flow.

With all that being said, I would still suggest making a claim for your use case at [Auth0: Secure access for everyone. But not just anyone.](http://Auth0.com/feedback) as each claim is reviewed by our product team and helps set the tone for what comes next in our product roadmap.

---

<div class="post-metadata">

**Author:** ![daanporon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daanporon/32/13703_2.png) [@daanporon](https://community.auth0.com/u/daanporon)\
**Post date:** [September 20, 2019, 9:28am UTC](https://community.auth0.com/t/how-to-implement-mfa-step-up-when-using-auth0-js-sdk-for-authentication/27722/5 "2019-09-20T09:28:09Z")

</div>

Thanks,

The problem is that i’m not getting a mfa\_required error when using silent auth, but a login\_required error. If this would throw a mfa\_required error then i would get a mfa\_token that i could use to start MFA.

The workarround with using the refresh\_token should work, no? actually it is working in our case, only when we retrieve the idToken after refresh and doing MFA … the idToken doesn’t contain anything that we can use to identify if MFA was executed or not … any idea about this?

There is no other way in retrieving a mfa\_token when using the embedded login? if we want to trigger MFA manually, and upgrade our token?

---

<div class="post-metadata">

**Author:** ![schuyler](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/schuyler/32/13498_2.png) [@schuyler](https://community.auth0.com/u/schuyler)\
**Post date:** [December 4, 2019, 7:37pm UTC](https://community.auth0.com/t/how-to-implement-mfa-step-up-when-using-auth0-js-sdk-for-authentication/27722/6 "2019-12-04T19:37:05Z")

</div>

I’m actually struggling with this myself and stumbled upon the refresh token solution as well. However, there are other ways to call the /oauth/token endpoint and get that mfa\_required error with the token. You can also enable the password grant type and call the endpoint with a username and password. See [grant types](https://auth0.com/docs/applications/reference/grant-types-auth0-mapping) and [api docs](https://auth0.com/docs/api/authentication#resource-owner-password). This should be only for trusted first-party applications though ☹ and seems just as hacky as the refresh token method. Embedded MFA should definitely be part of the product roadmap.

[Edit]: I see the UI-less guardian library [here](https://github.com/auth0/auth0-guardian.js). Would it be possible to use this library to embed multi-factor authentication? I.e. flow would look like: call to authorize endpoint is made, user signs in through social identity provider, user is redirected back to app with access token. The UI-less guardian library is invoked with a challenge code obtained from the user, auth0 verifies the code, then the user is logged in if the verification succeeds.

---

<div class="post-metadata">

**Author:** ![christopherreay](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/christopherreay/32/21716_2.png) [@christopherreay](https://community.auth0.com/u/christopherreay)\
**Post date:** [June 3, 2020, 7:48pm UTC](https://community.auth0.com/t/how-to-implement-mfa-step-up-when-using-auth0-js-sdk-for-authentication/27722/7 "2020-06-03T19:48:04Z")

</div>

I was thinking to set up another Auth0 Application, and use that to authenticate for these areas of our site.

Then we can manage users between the two spaces. Its not idea, but it should work.

Are there any reasons it wont, or is a terrible idea?

The other idea I had was to implement MFA locally to our server, and use Auth0 to store encryption keys for that data… but its not ideal

---

<div class="post-metadata">

**Author:** ![omer.kahoot](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/omer.kahoot/32/18419_2.png) [@omer.kahoot](https://community.auth0.com/u/omer.kahoot)\
**Post date:** [September 4, 2020, 7:33am UTC](https://community.auth0.com/t/how-to-implement-mfa-step-up-when-using-auth0-js-sdk-for-authentication/27722/8 "2020-09-04T07:33:08Z")

</div>

We are also facing this problem.

How can we setup multi factor authentication on our embedded login using Auth0.js SDK?  
Were you able to solve this somehow? I have tried calling checkSession through the API but it only returns:

> 1. code: “login\_required”
> 2. description: “Login required”
> 3. error: “login\_required”
> 4. error\_description: “Login required”

---

<div class="post-metadata">

**Author:** ![olga.grabek](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/olga.grabek/32/72176_2.png) [@olga.grabek](https://community.auth0.com/u/olga.grabek)\
**Post date:** [October 23, 2025, 5:22am UTC](https://community.auth0.com/t/how-to-implement-mfa-step-up-when-using-auth0-js-sdk-for-authentication/27722/9 "2025-10-23T05:22:49Z")

</div>

Six years later…. Is there any way to use Auth0.js SDK to implement step-up authentication? I still can’t find any code examples for that.
