# MFA not offered to user after login

**URL:** <https://community.auth0.com/t/mfa-not-offered-to-user-after-login/161256>\
**Category:** Get Help\
**Tags:** mfa-prompt-classic-experience, mfa\
**Created:** [December 11, 2024, 2:13pm UTC](https://community.auth0.com/t/mfa-not-offered-to-user-after-login/161256 "2024-12-11T14:13:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjh1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sjh1/32/61598_2.png) [@sjh1](https://community.auth0.com/u/sjh1)\
**Post date:** [December 11, 2024, 2:13pm UTC](https://community.auth0.com/t/mfa-not-offered-to-user-after-login/161256/1 "2024-12-11T14:13:02Z")

</div>

I have an issue where MFA is not offered to user after he fills username and password fields and clicks on continue.  
Require Multi-factor Auth is set to “Never”  
Customize MFA factors using Actions is set to “On”  
Action is on post login trigger. Action code:  
api.authentication.challengeWith({type: “email”});  
User is enrolled with email address.

User is redirected from my Angular application to another Angular application that serves for login using Auth0. Here is the code from that app that calls Auth0.

```auto
   this.auth.loginWithRedirect({
          appState: { target: String('https://' + commingFromUrl + (commingFromUrl == 'localhost' ? ':44465' : '')) },
          authorizationParams: { redirect_uri: "https://authentication.elso.org/redirectlogin" }
        });

```

Then ‘redirectlogin’ page has next code:

```auto
this.auth.getAccessTokenSilently().subscribe({
        next: (res) => {
          localStorage.setItem('auth0token', res);
          console.log('logged in');

        },
        error: (err) => {
          console.log(err);
          ERROR THROWN HERE Multifactor authentication Required
        }
      });

```

Here is what i have in app.module.ts

```auto
provideAuth0({
      domain: 'elso-auth.us.auth0.com',//'dev-gejvuq6zrfzh5ddy.us.auth0.com',
      clientId: 'MyClientId',       
      useRefreshTokens: true,
      cacheLocation: 'localstorage',
      useRefreshTokensFallback: true,
      authorizationParams: {
        redirect_uri: window.location.origin, 
        audience: 'https://elso-auth.us.auth0.com/api/v2/'
        , scope: 'openid profile email offline_access'

      }
    })

```

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [December 11, 2024, 2:59pm UTC](https://community.auth0.com/t/mfa-not-offered-to-user-after-login/161256/2 "2024-12-11T14:59:13Z")

</div>

Hi @sjh1

Welcome to the Auth0 Community!

Thank you for posting your question! I’ve checked your tenant configuration, and it looks like you haven’t enabled the factors required by your actions to challenge the user. Can you enable them and let me know if this fixes your issue?

I also found this blog article that can provide additional context → [Using Actions to Customize Your MFA Factors](https://auth0.com/blog/using-actions-to-customize-your-mfa-factors/)

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![sjh1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sjh1/32/61598_2.png) [@sjh1](https://community.auth0.com/u/sjh1)\
**Post date:** [December 11, 2024, 3:06pm UTC](https://community.auth0.com/t/mfa-not-offered-to-user-after-login/161256/3 "2024-12-11T15:06:11Z")

</div>

MFA factors are enabled, here is the screenshot. Is there some other option that i need to enable?

 ![mfa](https://global.discourse-cdn.com/auth0/original/3X/b/d/bd889f70f8f8c234af63e58259292ba98175ba8c.png)

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [December 11, 2024, 3:10pm UTC](https://community.auth0.com/t/mfa-not-offered-to-user-after-login/161256/4 "2024-12-11T15:10:49Z")

</div>

Hi @sjh1,

Apologise I’ve checked the development tenant not a production, I will update you when I will have more information.

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![sjh1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sjh1/32/61598_2.png) [@sjh1](https://community.auth0.com/u/sjh1)\
**Post date:** [December 11, 2024, 4:48pm UTC](https://community.auth0.com/t/mfa-not-offered-to-user-after-login/161256/5 "2024-12-11T16:48:08Z")

</div>

I found some clue. When i check ‘remember this device for 30 days’ after logging in and trying second login im not welcomed with MFA, just login username and password, and after redirection i receive ‘Multifactor authentication required’, and im not able to login after that… How can i resolve this issue? I cleared cookies and sessions and local storage on both apps.

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [December 11, 2024, 5:15pm UTC](https://community.auth0.com/t/mfa-not-offered-to-user-after-login/161256/6 "2024-12-11T17:15:54Z")

</div>

Hi @sjh1,

Is MFA not triggered only for a specific user or all users?

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![sjh1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sjh1/32/61598_2.png) [@sjh1](https://community.auth0.com/u/sjh1)\
**Post date:** [December 11, 2024, 5:27pm UTC](https://community.auth0.com/t/mfa-not-offered-to-user-after-login/161256/7 "2024-12-11T17:27:58Z")

</div>

It is for all users, i just double checked. I am able to receive MFA until i check remember this device. After that i only receive username/password and after clicking continue im redirected to my callback page, and there ‘Multifactor authentication required’ is fired.

---

<div class="post-metadata">

**Author:** ![sjh1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sjh1/32/61598_2.png) [@sjh1](https://community.auth0.com/u/sjh1)\
**Post date:** [December 12, 2024, 10:19pm UTC](https://community.auth0.com/t/mfa-not-offered-to-user-after-login/161256/8 "2024-12-12T22:19:06Z")

</div>

I managed to find solution myself. For those who have issue like mine. In angular i had wraped auth0 login calls in timeout like this:

```auto
setTimeout(() => {
this.auth.getAccessTokenSilently().subscribe({
  next: (res) => {
	console.log('bingo');
  },
  error: (err) => {
	console.log(err);
	if (err.error_description == 'Login required') {
	  this.auth.loginWithRedirect();
	}
  }
});
}, 1000);//Tried timeout with 500, and didnt work.

```

Without that, i could call login multiple times on same rout, and it always throw Multifactor required, even if multifactor was not offered to user because ‘remember browser’ was checked.

---

<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:** [December 26, 2024, 10:19pm UTC](https://community.auth0.com/t/mfa-not-offered-to-user-after-login/161256/9 "2024-12-26T22:19:41Z")

</div>

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