Configure Conditional Multi-Factor Authentication for Database Connections
This article explains how to configure a tenant to apply Multi-Factor Authentication (MFA) specifically for username and password connections, ensuring that users with Enterprise connections are not prompted for MFA.
- Actions
- Multi-Factor Authentication (MFA)
- Database connections
- Enterprise connections
- Go to Security > Multi-factor Auth in the Auth0 Dashboard.
-
Select Never under the Define policies section.
-
NOTE: Setting this to Never ensures that MFA is only triggered by the custom Action.
-
-
Select Customize MFA using actions.
-
Go to Actions > Library.
-
Select Build from Scratch.
-
Enter a descriptive name (for example, MFA for Database Users).
-
Select Login / Post Login in the Select a trigger modal.
-
Select Create.
-
Enter the following code in the editor to check the connection strategy and enable MFA only for database connections:
JavaScript -
Select Deploy.
-
Go to Actions > Triggers.
-
Select Post-login.
-
Drag the created Action from the Add Action panel to the execution flow.
-
Select Apply.