# Rule after successful MFA

**URL:** <https://community.auth0.com/t/rule-after-successful-mfa/67197>\
**Category:** Get Help\
**Tags:** rules, mfa\
**Created:** [August 2, 2021, 1:33am UTC](https://community.auth0.com/t/rule-after-successful-mfa/67197 "2021-08-02T01:33:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodrigo.arias](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rodrigo.arias/32/30876_2.png) [@rodrigo.arias](https://community.auth0.com/u/rodrigo.arias)\
**Post date:** [August 2, 2021, 1:33am UTC](https://community.auth0.com/t/rule-after-successful-mfa/67197/1 "2021-08-02T01:33:19Z")

</div>

Hi,  
I’m using a custom MFA rule in which I return the context object with a multifactor challenge.  
I want to add a following rule, but I’m not sure if that rule would be executed after the user has succesfully acomplished the multifactor or not. (That would be the desired behaviour, I want to execute a last rule knowing that the MFA has been completed).

---

<div class="post-metadata">

**Author:** ![crawford.king](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/crawford.king/32/45342_2.png) [@crawford.king](https://community.auth0.com/u/crawford.king)\
**Post date:** [March 10, 2023, 9:51pm UTC](https://community.auth0.com/t/rule-after-successful-mfa/67197/2 "2023-03-10T21:51:46Z")

</div>

I also have this question. Any insights would be much appreciated!

My use case involves storing a custom field in user metadata if MFA is successful.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [March 14, 2023, 11:14pm UTC](https://community.auth0.com/t/rule-after-successful-mfa/67197/5 "2023-03-14T23:14:49Z")

</div>

Hey there @crawford.king! (Sorry for the lack of response @rodrigo.arias)

Please see the following post:

> [@Update user metadata after MFA completion](https://community.auth0.com/t/update-user-metadata-after-mfa-completion/102523/3):
>
> Hi there @hunter1! Unfortunately as you’ve noticed MFA does not complete until after Actions/Rules have executed - It’s outside the scope of an Action, but you could potentially look at ID token claims to see if MFA was performed, or add a claim to an access token to indicate that MFA was required for a given login and go about it that way. An ID token returned after a login requiring MFA will contain both the acr and amr claims: Hope this helps!

Hope this helps!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [March 28, 2023, 11:15pm UTC](https://community.auth0.com/t/rule-after-successful-mfa/67197/6 "2023-03-28T23:15:08Z")

</div>

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