# Auth0 asks for Guardian instead of any MFA provider

**URL:** <https://community.auth0.com/t/auth0-asks-for-guardian-instead-of-any-mfa-provider/70369>\
**Category:** Get Help\
**Created:** [September 28, 2021, 7:58am UTC](https://community.auth0.com/t/auth0-asks-for-guardian-instead-of-any-mfa-provider/70369 "2021-09-28T07:58:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![emanuele.casadio](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emanuele.casadio/32/31981_2.png) [@emanuele.casadio](https://community.auth0.com/u/emanuele.casadio)\
**Post date:** [September 28, 2021, 7:58am UTC](https://community.auth0.com/t/auth0-asks-for-guardian-instead-of-any-mfa-provider/70369/1 "2021-09-28T07:58:00Z")

</div>

Hello everybody. I have added a Rule that enforces MFA only for users belonging to specific roles. You can find the rule below.

When the rule is off, MFA is correctly being asked for nobody.  
As soon as I turn the rule on, Auth0 starts asking these users in our applications to enroll in Auth0 Guardian even if they have already configured an alternative MFA provider such as Google Authenticator.

 ![Schermata 2021-09-28 alle 10.09.17](https://global.discourse-cdn.com/auth0/original/3X/e/7/e711226fe92be2486f89ee19eabe518dcc847496.png)

Strangely, when these users try to login into [auth0.com](http://auth0.com) (because some users are also Auth0 tenant admins), in this case the rule works correctly by just asking for _ **ANY** _ MFA token and it does not try to enroll users in Auth0 Guardian.

 ![Schermata 2021-09-28 alle 10.10.20](https://global.discourse-cdn.com/auth0/original/3X/a/2/a2db368a241ecbb75a9478312e3a9d4caf2604a2.png)

```auto
function multifactorAuthentication(user, context, callback) {
  const assignedRoles = (context.authorization || {}).roles || [];
  const requireMfaRoles = ["god"];
  const inCommon = assignedRoles.some(r => requireMfaRoles.includes(r));
  if (inCommon) {
    // Force 2FA
    context.multifactor = {
      provider: 'any',
      allowRememberBrowser: false
    };
  }
  callback(null, user, context);
}

```

Attached you can find a PDF screenshot that shows the configuration of MFA.

[Multifactor Authentication.pdf](https://community.auth0.com/uploads/short-url/nUJ7UzeDoNSV4UrPpdyyVrCaoBo.pdf) (343.1 KB)

Thank you in advance.  
Emanuele

---

<div class="post-metadata">

**Author:** ![emanuele.casadio](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emanuele.casadio/32/31981_2.png) [@emanuele.casadio](https://community.auth0.com/u/emanuele.casadio)\
**Post date:** [September 28, 2021, 8:15am UTC](https://community.auth0.com/t/auth0-asks-for-guardian-instead-of-any-mfa-provider/70369/2 "2021-09-28T08:15:32Z")

</div>

I’ve just discovered that in order to use MFAs other than Auth0 Guardian you need to have an active Professional subscription. 😅

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [September 28, 2021, 12:07pm UTC](https://community.auth0.com/t/auth0-asks-for-guardian-instead-of-any-mfa-provider/70369/3 "2021-09-28T12:07:25Z")

</div>

No worries! We’ve all been there! Thanks for sharing with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [September 30, 2021, 9:52am UTC](https://community.auth0.com/t/auth0-asks-for-guardian-instead-of-any-mfa-provider/70369/4 "2021-09-30T09:52:49Z")

</div>


