# Disable MFA for enterprise connection

**URL:** <https://community.auth0.com/t/disable-mfa-for-enterprise-connection/106790>\
**Category:** Get Help\
**Tags:** mfa-api, mfa\
**Created:** [May 12, 2023, 2:48am UTC](https://community.auth0.com/t/disable-mfa-for-enterprise-connection/106790 "2023-05-12T02:48:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcfn](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@lcfn](https://community.auth0.com/u/lcfn)\
**Post date:** [May 12, 2023, 2:48am UTC](https://community.auth0.com/t/disable-mfa-for-enterprise-connection/106790/1 "2023-05-12T02:48:09Z")

</div>

I have setup a SAML Enterprise Connection to delegate authentication to another IdP. When users login at the IdP they perform MFA there. However, when the SAML response is sent to Auth0 it fails due to the “always require MFA settings” I have other Authentication methods configured in this tenant and I want to disable MFA for this Enterprise SAML connection only.

---

<div class="post-metadata">

**Author:** ![SaqibHussain](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/saqibhussain/32/42924_2.png) [@SaqibHussain](https://community.auth0.com/u/SaqibHussain)\
**Post date:** [May 12, 2023, 11:10pm UTC](https://community.auth0.com/t/disable-mfa-for-enterprise-connection/106790/3 "2023-05-12T23:10:14Z")

</div>

Hi @lcfn

Welcome to the Auth0 community.

You should be able to achieve this use case by using selective MFA via a Post Login Action as per [https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow#enforce-custom-mfa-policy](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow#enforce-custom-mfa-policy)

To get this to work you need to set MFA policy to “Never” (Security \> Multi-factor Auth) but keep your existing MFA factors in place e.g. if one-time password and email are both switched on, leave them switched on. The MFA will be controlled by the Action instead.

For your specific use case, you may be able to use an Action like the below (please test in a non production tenant):

```auto
exports.onExecutePostLogin = async (event, api) => {
  // Require MFA for any connection apart from conn2
  if (event.connection.name !== "conn2") {
    api.multifactor.enable("any");
  };
};

```

You can just pop your connection name in the above and that should work (please test). All other connections should require MFA.

Please let us know if you need anything further.

Warm regards.

---

<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:** [May 26, 2023, 11:10pm UTC](https://community.auth0.com/t/disable-mfa-for-enterprise-connection/106790/4 "2023-05-26T23:10:58Z")

</div>

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