Auth0 Action API Method Difference Between "api.multifactor.enable" and "api.authentication.challengeWithAny"
Last Updated:
Overview
The Auth0 Application Programming Interface (API) documentation for Post-Login Actions includes two methods related to Multi-Factor Authentication (MFA): api.multifactor.enable(provider, options) and api.authentication.challengeWithAny. Understanding the differences between these methods allows administrators to correctly configure MFA challenges and factor groups within Auth0 Actions.
Applies To
- Auth0
- Post-Login Actions
- Multi-Factor Authentication (MFA)
api.authentication.challengeWithAnyapi.multifactor.enable(provider, options)
Solution
What are the differences between the two MFA Action API methods?
The difference between these two methods is covered in more detail in the Customize MFA Selection for Universal Login documentation.
In addition to the above documentation, here are some additional details regarding these methods:
For the api.multifactor.enable(), the supported providers are the following:
- "any" Use any of the configured challenges.
- "duo" Use the Duo multifactor provider.
- "google-authenticator" Use the Google Authenticator provider.
- "guardian" Use the Guardian provider.
- "none" Use none of the configured challenges to prevent the MFA flow from triggering.
If the goal is to enable MFA challenges("any") or either "duo", "google-authenticator", or "guardian", then call the api.multifactor.enable().
When using the api.authentication.challengeWithAny, it will enable a group of factors in one call; below is what a sample call looks like:
api.authentication.challengeWithAny([{ type: 'otp'}, { type: 'push-notification' }]);