How to Automatically Turn On and Off the MFA in the Tenant
Last Updated:
Overview
Applies To
- Multifactor Authentication (MFA)
Solution
-
Via a tenant-wide policy
If MFA is enforced via a policy at Security > Multi-factor Auth page in the dashboard, this policy can be toggled using the PUT /api/v2/guardian/policies endpoint as described here.
If it is desired to choose Never as the policy, simply pass in an empty array.
-
Via a Post-Login Action
If MFA is enforced conditionally via a Post-Login Action, update and deploy the Action programmatically. Use the following two endpoints for this:
- PATCH /api/v2/actions/actions/{id} - https://auth0.com/docs/api/management/v2/actions/patch-action
- POST /api/v2/actions/actions/{id}/deploy - https://auth0.com/docs/api/management/v2/actions/post-deploy-action
This can also be achieved via tools like Auth0 Deploy CLI and Auth0 Terraform Provider by updating the respective entities.