# Not able to login 1st time when mfa is enabled gettiing error (mfa\_required)

**URL:** <https://community.auth0.com/t/not-able-to-login-1st-time-when-mfa-is-enabled-gettiing-error-mfa-required/118054>\
**Category:** Get Help\
**Tags:** mfa-api, mfa\
**Created:** [October 8, 2023, 3:01pm UTC](https://community.auth0.com/t/not-able-to-login-1st-time-when-mfa-is-enabled-gettiing-error-mfa-required/118054 "2023-10-08T15:01:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhijeet.mishra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/abhijeet.mishra/32/47986_2.png) [@abhijeet.mishra](https://community.auth0.com/u/abhijeet.mishra)\
**Post date:** [October 8, 2023, 3:01pm UTC](https://community.auth0.com/t/not-able-to-login-1st-time-when-mfa-is-enabled-gettiing-error-mfa-required/118054/1 "2023-10-08T15:01:37Z")

</div>

Hi there,

```auto
{
error.error: mfa_required,
error.error_description: Multifactor Authentication required
}

```

This error occurs consistently when I attempt to log in for the first time, but it does not appear during subsequent login attempts. Essentially, the initial login always fails with the “mfa\_required” error, while the second attempt is successful.

If you have experienced a similar problem or have any insights on how to troubleshoot and rectify this error, please share your expertise.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 11, 2023, 5:53pm UTC](https://community.auth0.com/t/not-able-to-login-1st-time-when-mfa-is-enabled-gettiing-error-mfa-required/118054/3 "2023-10-11T17:53:46Z")

</div>

Hi @abhijeet.mishra,

Can you please provide some additional details about your setup?

---

<div class="post-metadata">

**Author:** ![william.occelli](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/william.occelli/32/51735_2.png) [@william.occelli](https://community.auth0.com/u/william.occelli)\
**Post date:** [October 18, 2023, 7:14am UTC](https://community.auth0.com/t/not-able-to-login-1st-time-when-mfa-is-enabled-gettiing-error-mfa-required/118054/4 "2023-10-18T07:14:49Z")

</div>

Hi @dan.woda,

We encounter the exact same issue as @abhijeet.mishra. We activated the MFA on our production tenant, however, the first login (right after signup) systematically fails because the ` /authorize?client_id=...` responds with a 200 OK but in the response body there is an mfa\_required error :

```auto
               var authorizationResponse = {
                    type: "authorization_response",
                    response: {
                        "error": "login_required",
                        "error_description": "Multifactor authentication required",
                        "state": "TVZlSVlBUkpRNUJNWUtEX0pxdjNwTmVrVmNSV01mcXZYOXgxZmdKMHF4TQ=="
                    }
                };

```

When we refresh the web page, we are asked a new MFA code and everything works as expected.

We are using an Angular App with the AuthModule (`"@auth0/auth0-angular": "^2.1.0"`):

```auto
        AuthModule.forRoot({
            domain: environment.auth_domain,
            clientId: environment.auth_clientId,
            authorizationParams: {
                redirect_uri: window.location.origin + '/private',
                audience: environment.auth_audience
            },
            httpInterceptor: {
                allowedList: [`${environment.backendUrl}/*`]
            }
        }),

```

Any help would be much appreciated,  
Thanks,  
William

**EDIT:**  
We found the root cause of our problem: we were using silent tokens (getTokenSilently) which do not work when MFA is activated and `rememberBrowser` is false.

To overcome this issue we did the following:

- We created an action with the code proposed in the documentation ([Configure Silent Authentication](https://auth0.com/docs/authenticate/login/configure-silent-authentication#silent-authentication-with-multi-factor-authentication))
- We set the MFA to ‘Never’

This is counter-intuitive but we got the expected result. In fact, the action checks for the presence of MFA in the context. When there is no MFA or `rememberBrowser` is false, it challenges the user with an MFA. When there is MFA and the `rememberBrowser` is true, login proceeds.

Note: it could be interesting to specify that MFA should be set to ‘Never’ in the documentation: [Configure Silent Authentication](https://auth0.com/docs/authenticate/login/configure-silent-authentication#silent-authentication-with-multi-factor-authentication)

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 18, 2023, 2:34pm UTC](https://community.auth0.com/t/not-able-to-login-1st-time-when-mfa-is-enabled-gettiing-error-mfa-required/118054/5 "2023-10-18T14:34:03Z")

</div>

Thanks for the update and solution @william.occelli!

Welcome to the Auth0 Community!

---

<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:** [November 1, 2023, 2:34pm UTC](https://community.auth0.com/t/not-able-to-login-1st-time-when-mfa-is-enabled-gettiing-error-mfa-required/118054/6 "2023-11-01T14:34:55Z")

</div>

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