# Can I configure MFA for a particular application not for all?

**URL:** <https://community.auth0.com/t/can-i-configure-mfa-for-a-particular-application-not-for-all/104557>\
**Category:** Get Help\
**Tags:** one-time-password-otp-factor, mfa\
**Created:** [April 12, 2023, 6:55pm UTC](https://community.auth0.com/t/can-i-configure-mfa-for-a-particular-application-not-for-all/104557 "2023-04-12T18:55:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vvijayakumar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@vvijayakumar](https://community.auth0.com/u/vvijayakumar)\
**Post date:** [April 12, 2023, 6:55pm UTC](https://community.auth0.com/t/can-i-configure-mfa-for-a-particular-application-not-for-all/104557/1 "2023-04-12T18:55:51Z")

</div>

I am using multiple applications with a single auth0 tenant. Can I configure MFA for a particular application not for all?

---

<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:** [April 12, 2023, 9:49pm UTC](https://community.auth0.com/t/can-i-configure-mfa-for-a-particular-application-not-for-all/104557/3 "2023-04-12T21:49:44Z")

</div>

Hi @vvijayakumar,

Welcome to the Auth0 Community!

Yes, that is possible by using Auth0 Actions to conditionally enforce MFA for a specific application.

The code would look something like the following:

```auto
exports.onExecutePostLogin = async (event, api) => {
  if(event.client.client_id === 'YOUR_CLIENT_ID') {
    api.multifactor.enable('any');
  }
};

```

(Reference: [Post-Login Action - Enforce Custom MFA Policy](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow#enforce-custom-mfa-policy))

I hope this helps!

Please reach out if you have any questions.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![vvijayakumar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@vvijayakumar](https://community.auth0.com/u/vvijayakumar)\
**Post date:** [April 13, 2023, 9:39am UTC](https://community.auth0.com/t/can-i-configure-mfa-for-a-particular-application-not-for-all/104557/4 "2023-04-13T09:39:02Z")

</div>

Thank you very much Ruben.

---

<div class="post-metadata">

**Author:** ![vvijayakumar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@vvijayakumar](https://community.auth0.com/u/vvijayakumar)\
**Post date:** [April 14, 2023, 10:34am UTC](https://community.auth0.com/t/can-i-configure-mfa-for-a-particular-application-not-for-all/104557/5 "2023-04-14T10:34:24Z")

</div>

**It did not work in my real application. So I made a proof of concept.**

**Step 1: I have created two single-page applications.**

**Step 2: Under the Security tab, I enabled Phone Message MFA.**

**Step 3: Developed a customised action.**

```auto
exports.onExecutePostLogin = async (event, api) => {
  if(event.client.client_id === 'LJ0a69xMbbIXOr5ClAQoGC6MGhb1IkE1') {
    api.multifactor.enable('any');
  }
};

```

**Step 4: Add the action to the login flow.**

 ![image](https://global.discourse-cdn.com/auth0/original/3X/2/4/240bd1547822c52c975619302276d2375cae0a2b.jpeg)

Nonetheless, MFA had an impact on both of my applications. Where did I make a mistake?

Thanks  
Vimal

---

<div class="post-metadata">

**Author:** ![peter.fernandez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peter.fernandez/32/45477_2.png) [@peter.fernandez](https://community.auth0.com/u/peter.fernandez)\
**Post date:** [April 14, 2023, 12:02pm UTC](https://community.auth0.com/t/can-i-configure-mfa-for-a-particular-application-not-for-all/104557/6 "2023-04-14T12:02:29Z")

</div>

Hi Vimal 🙂

In addition, you’ll want to make sure your (MFA) configuration has `Require Multi-Factor Auth` set to either `None` or `Use Adaptive MFA` (see [here](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa) for details). If you have it set to `Always` then the conditional logic in your action will effectively be overridden.

Hope that helps 🕶

---

<div class="post-metadata">

**Author:** ![vvijayakumar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@vvijayakumar](https://community.auth0.com/u/vvijayakumar)\
**Post date:** [April 14, 2023, 12:35pm UTC](https://community.auth0.com/t/can-i-configure-mfa-for-a-particular-application-not-for-all/104557/7 "2023-04-14T12:35:11Z")

</div>

**Oh, yes, that was the error I made.**  
You come through for me. Peter, thank you very much.

---

<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:** [April 28, 2023, 12:35pm UTC](https://community.auth0.com/t/can-i-configure-mfa-for-a-particular-application-not-for-all/104557/8 "2023-04-28T12:35:19Z")

</div>

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