-
Notifications
You must be signed in to change notification settings - Fork 31
Update to clarify Actions examples #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…assword reset flow
| * The [`api.multifactor.enable`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-api-object#api-multifactor) Action trigger to handle both enrollment and issues configured MFA challenges at the end of the login flow. | ||
| * The [`event.user.multifactor`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-event-object) Actions trigger with the user's enrolled factors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Actions trigger" or "Action trigger"? (not sure which one is the right way to refer to the product)
| * The [`event.user.multifactor`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-event-object) Actions trigger with the user's enrolled factors. | ||
|
|
||
| <Callout icon="file-lines" color="#0EA5E9" iconType="regular"> | ||
| Since `email` notifications are not an independent factor, the condition `const canPromptMfa = event.user.multifactor && event.user.multifactor.length > 0;` will return `false` if the user only has `email` as a factor. To learn more, read [Configure Email Notifications for MFA](/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-email-notifications-for-mfa). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Since `email` notifications are not an independent factor, the condition `const canPromptMfa = event.user.multifactor && event.user.multifactor.length > 0;` will return `false` if the user only has `email` as a factor. To learn more, read [Configure Email Notifications for MFA](/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-email-notifications-for-mfa). | |
| Since `email` notifications are not an independent factor, the condition `event.user.multifactor && event.user.multifactor.length > 0` will return `false` if the user only has `email` as a factor. To learn more, read [Configure Email Notifications for MFA](/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-email-notifications-for-mfa). |
| // It only makes sense to prompt for MFA when the user has at least one | ||
| // enrolled MFA factor. | ||
| const canPromptMfa = event.user.enrolledFactors && event.user.enrolledFactors.length >0; | ||
|
|
||
| if (shouldPromptMfa && canPromptMfa) { | ||
| api.authentication.challengeWithAny([ {type: "email"}, {type:"phone"} ]); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // It only makes sense to prompt for MFA when the user has at least one | |
| // enrolled MFA factor. | |
| const canPromptMfa = event.user.enrolledFactors && event.user.enrolledFactors.length >0; | |
| if (shouldPromptMfa && canPromptMfa) { | |
| api.authentication.challengeWithAny([ {type: "email"}, {type:"phone"} ]); | |
| } | |
| // It only makes sense to prompt for MFA when the user has at least one | |
| // enrolled MFA factor. | |
| const canPromptMfa = event.user.enrolledFactors && event.user.enrolledFactors.length > 0; | |
| if (shouldPromptMfa && canPromptMfa) { | |
| api.authentication.challengeWithAny([ {type: "email"}, {type:"phone"} ]); | |
| } |
| ### Adaptive MFA template | ||
|
|
||
| This template provides an example and starting point for how to build a custom business flow using individual risk assessments. | ||
| This template provides an example and starting point for how to build a custom business flow using individual risk assessments. In this example, we use: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This template provides an example and starting point for how to build a custom business flow using individual risk assessments. In this example, we use: | |
| This template provides an example and starting point for how to build a custom business flow using individual risk assessments. This example uses: |
| This template provides an example and starting point for how to build a custom business flow using individual risk assessments. | ||
| This template provides an example and starting point for how to build a custom business flow using individual risk assessments. In this example, we use: | ||
|
|
||
| * The [`api.multifactor.enable`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-api-object#api-multifactor) Action trigger to handle both enrollment and issues configured MFA challenges at the end of the login flow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * The [`api.multifactor.enable`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-api-object#api-multifactor) Action trigger to handle both enrollment and issues configured MFA challenges at the end of the login flow. | |
| * The [`api.multifactor.enable`](/docs/customize/actions/explore-triggers/signup-and-login-triggers/login-trigger/post-login-api-object#api-multifactor) Action trigger to handle both enrollment and issue configured MFA challenges at the end of the login flow. |
| ``` javascript | ||
| // It only makes sense to prompt for MFA when the user has at least one | ||
| // enrolled MFA factor. | ||
| const canPromptMfa = event.user.enrolledFactors && event.user.enrolledFactors.length >0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change also uses event.user.enrolledFactors rather than event.user.multifactor, so it would be good to have an explanation of the difference or the reason for the change. is it because enrolledFactors counts email and multifactor doesn't?
By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.
Description
Requested update to clarify Adaptive MFA template and use of
emailas a secondary factor.References
Docs Request
Testing
Local
Checklist