# "MFA every X days" without Adaptive MFA

**URL:** <https://community.auth0.com/t/mfa-every-x-days-without-adaptive-mfa/111811>\
**Category:** Get Help\
**Tags:** adaptive-mfa, mfa\
**Created:** [July 21, 2023, 1:52pm UTC](https://community.auth0.com/t/mfa-every-x-days-without-adaptive-mfa/111811 "2023-07-21T13:52:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [July 21, 2023, 1:52pm UTC](https://community.auth0.com/t/mfa-every-x-days-without-adaptive-mfa/111811/1 "2023-07-21T13:52:32Z")

</div>

I’m trying to figure out how to write an Action (or Rule if necessary) that implements the following logic:

```auto
if new device:
  require mfa
else if last MFA was more than 7 days ago:
  require mfa

```

The gist: require the user to MFA at least every 7 days, but also capture cases where there’s no evidence of having previously MFA’d from the device/browser in question.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 24, 2023, 6:28pm UTC](https://community.auth0.com/t/mfa-every-x-days-without-adaptive-mfa/111811/3 "2023-07-24T18:28:45Z")

</div>

Hi @markd,

> [@markd](#):
>
> ```auto
> if new device:
> 
> ```

Check out the [NewDevice](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/event-object) object:

```js
event.authentication.riskAssessment.assessments.NewDevice.confidence

```

> [@markd](#):
>
> `else if last MFA was more than 7 days ago:`

For this, you’ll need to set up a way to store and check for the last time a user was able to authenticate with MFA. I think you could use app\_metadata for this.

---

<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:** [August 23, 2023, 2:39pm UTC](https://community.auth0.com/t/mfa-every-x-days-without-adaptive-mfa/111811/4 "2023-08-23T14:39:48Z")

</div>

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