# Mfa email after authentification

**URL:** <https://community.auth0.com/t/mfa-email-after-authentification/154501>\
**Category:** Get Help\
**Tags:** email-factor, mfa\
**Created:** [November 27, 2024, 3:12pm UTC](https://community.auth0.com/t/mfa-email-after-authentification/154501 "2024-11-27T15:12:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jal.monagi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jal.monagi/32/63268_2.png) [@jal.monagi](https://community.auth0.com/u/jal.monagi)\
**Post date:** [November 27, 2024, 3:12pm UTC](https://community.auth0.com/t/mfa-email-after-authentification/154501/1 "2024-11-27T15:12:44Z")

</div>

In my auth0 authentication approach, I want the user to enter their email and password if that coordinates we send a code to their email and we display a popup to enter this code. if possible to implement this in Auth0? and thank you in advance

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [November 27, 2024, 8:42pm UTC](https://community.auth0.com/t/mfa-email-after-authentification/154501/3 "2024-11-27T20:42:44Z")

</div>

Hello @jal.monagi ,

Welcome to the Auth0 Community!

I understand that your preference is to only have Email as a MFA factor. We do not recommend this as Email does not offer the highest security, but if this is your desired flow, we can make that happen.

You will need to enable some settings in your tenant and also have an Action for everything to work, as follows:

1. Access the Authentication tab within your tenant and go to Authentication Profile. In here, select “ Identifier + Password “ and click on “ Save”.

2. Following this, navigate to [Security → Multi-factor Auth](https://auth0.com/docs/secure/multi-factor-authentication/enable-mfa#:~:text=Multi%2DFactor%20Authentication-,Enable%20Multi%2DFactor%20Authentication,-You%20can%20enable). In here, you will need to enable two factors, as Auth0 restricts having Email as the only MFA factor.

3. Head over to Actions → Triggers, select the Post-Login Action, click on the “+” sign to create a new Action from scratch. You can use the following:

```auto
exports.onExecutePostLogin = async (event, api) => {
if(event.authentication && event.user.email_verified){
api.authentication.challengeWith ({type:"email"})
} else {
api.access.deny ("Please verify your email in order to access your account")
 }
};

```

1. Click on Deploy, add the Action to Post Login flow and click on Apply

Your users will need to have their [Email Verified](https://auth0.com/docs/secure/multi-factor-authentication/multi-factor-authentication-factors/configure-email-notifications-for-mfa#:~:text=They%20will%20get%20be%20able%20to%20use%20it%20when%20they%20have%20a%20verified%20email) in order to receive the code on their email. Because of the Action, users will be denied access and be prompted to verify their email in order to proceed. Once completed, the flow will only present them with the prompt to input the code they received over Email.

Alternatively, you can choose to skip the Action part and maintain the other settings described, which in turn will prompt the users to enroll in the other MFA factor. Once completed, on future logins the users will be prompted for the main factor (not Email), but will be presented with a button to **Try another method** where they can select Email as a factor.

Thank you!  
Gerald

---

<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:** [December 11, 2024, 8:43pm UTC](https://community.auth0.com/t/mfa-email-after-authentification/154501/4 "2024-12-11T20:43:30Z")

</div>

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