# What is the context.multifactor object?

**URL:** <https://community.auth0.com/t/what-is-the-context-multifactor-object/66020>\
**Category:** Get Help\
**Tags:** rules, documentation, mfa\
**Created:** [July 12, 2021, 7:23pm UTC](https://community.auth0.com/t/what-is-the-context-multifactor-object/66020 "2021-07-12T19:23:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cwaugh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cwaugh/32/16454_2.png) [@cwaugh](https://community.auth0.com/u/cwaugh)\
**Post date:** [July 12, 2021, 7:23pm UTC](https://community.auth0.com/t/what-is-the-context-multifactor-object/66020/1 "2021-07-12T19:23:06Z")

</div>

On [this page](https://auth0.com/rules/guardian-multifactor), we can see the following rule.

```auto
function guardianMultifactor(user, context, callback) {
  //const CLIENTS_WITH_MFA = ['REPLACE_WITH_YOUR_CLIENT_ID'];

  // run only for the specified clients
  //if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) {

  // uncomment the following if clause in case you want to request a second factor only from user's that have user_metadata.use_mfa === true
    //if (user.user_metadata && user.user_metadata.use_mfa){
      context.multifactor = {
        // required
        provider: 'guardian',

        // optional, defaults to true. Set to false to force Guardian authentication every time.
        // See https://auth0.com/docs/multifactor-authentication/custom#change-the-frequency-of-authentication-requests for details
        allowRememberBrowser: false
      };
    //}
  //}

  callback(null, user, context);
}

```

What is the structure of `context.multifactor`? The documentation [here](https://auth0.com/docs/rules/context-object) only says that it " An object representing the multifactor settings used in [implementing contextual MFA](https://auth0.com/docs/mfa).", with a link to a more general, but not-helpful explanation of MFA.

Basically, I want to know:

- What, specifically, is provider defining here? (ie. _must use guardian_ vs _shown guardian by default_)
- What other values can provider be set to? (ie. literal string must be one of this list: [“any”, “guardian”, …])
- What other parameters can be set in multifactor?
- What do they do?

---

<div class="post-metadata">

**Author:** ![dennis.kronbuegel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dennis.kronbuegel/32/33281_2.png) [@dennis.kronbuegel](https://community.auth0.com/u/dennis.kronbuegel)\
**Post date:** [November 29, 2022, 2:20pm UTC](https://community.auth0.com/t/what-is-the-context-multifactor-object/66020/2 "2022-11-29T14:20:15Z")

</div>

I would like to know that myself.

---

<div class="post-metadata">

**Author:** ![kalinda](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@kalinda](https://community.auth0.com/u/kalinda)\
**Post date:** [October 23, 2024, 12:41am UTC](https://community.auth0.com/t/what-is-the-context-multifactor-object/66020/3 "2024-10-23T00:41:42Z")

</div>

This was answered [here](https://community.auth0.com/t/specify-specific-mfa-factor/106283).

> This article indicated to me that `any, guardian, google-authenticator, duo` are the only options. [Customize Multi-Factor Authentication Pages (auth0.com)](https://auth0.com/docs/secure/multi-factor-authentication/customize-mfa#use-rules)

---

<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:** [March 24, 2025, 5:08pm UTC](https://community.auth0.com/t/what-is-the-context-multifactor-object/66020/4 "2025-03-24T17:08:43Z")

</div>

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