# enableMFA with auth0 jwt

**URL:** <https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [February 5, 2025, 5:27pm UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059 "2025-02-05T17:27:37Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![indirizzo722](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@indirizzo722](https://builder.metamask.io/u/indirizzo722)\
**Post date:** [February 5, 2025, 5:27pm UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/1 "2025-02-05T17:27:37Z")

</div>

> **🏛 Content from Web3Auth Community**
> 
> This topic was originally posted by **indirizzo722** on 2/5/2025.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

Hi,

i try to use enableMFA() function ([React Hooks for PnP No Modal SDK | Documentation | Web3Auth](https://web3auth.io/docs/sdk/pnp/web/no-modal/no-modal-hooks)), but i receive this error

```auto
There seems to be some bug in the code. Please contact support to fix this.
Invalid params for jwt login. Missing domain*
Error: Invalid params for jwt login. Missing domain: traceId: undefined - spanId: undefined

```

Why?

---

<div class="post-metadata">

**Author:** ![w3abot](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@w3abot](https://builder.metamask.io/u/w3abot)\
**Post date:** [February 5, 2025, 5:29pm UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/2 "2025-02-05T17:29:23Z")

</div>

Hello indirizzo 1!

Thanks for reaching out. It seems you’re experiencing an issue with using the `enableMFA()` function alongside Auth0 JWT in the Plug n Play SDK.

From the error message, it appears that the domain parameter might be missing in your Auth0 JWT login configuration. To better assist, could you please check the following:

1. **Code Snippets** : Share the section of your code where you’re initializing Web3Auth and setting up the JWT login. It will help us identify if there’s any missing configuration.

2. **Check Parameters** : Ensure that your JWT login configuration includes all necessary parameters, specifically the domain related to your Auth0 setup.

If you provide the code and any additional configuration details, the support team will be able to help you further!

Let me know if you need help with anything else. 😊

> Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

---

<div class="post-metadata">

**Author:** ![indirizzo722](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@indirizzo722](https://builder.metamask.io/u/indirizzo722)\
**Post date:** [February 5, 2025, 5:33pm UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/3 "2025-02-05T17:33:07Z")

</div>

```auto
async enableMFA(): Promise<void> {
    if (this.web3authInstance) {
      const mfa = await this.web3authInstance.enableMFA()
      console.log(mfa)
    }
  }

```

```auto

 // Connect to the Web3Auth adapter
      const web3authProvider = await this.web3authInstance.connectTo(WALLET_ADAPTERS.AUTH, {
        loginProvider: "jwt", // Specify the login provider (e.g., "jwt" for custom JWT-based login)

        extraLoginOptions: {
          domain: auth0Domain,
          verifierIdField: 'sub',

        },
      });

// Get openlogin adapter by provider
export const getOpenloginAdapterByProvider = (): AuthAdapter => {
  return new AuthAdapter({

    adapterSettings: {

      network: web3AuthNetwrok,
      uxMode: 'redirect',
      whiteLabel: {
        logoDark: ''
        logoLight: ''
        appName: '',
        appUrl: '', 
        defaultLanguage: 'en',
        theme: {
          primary: '#000000',
        },
        useLogoLoader: true,
      },

      loginConfig: {

        jwt: {
          verifier: auth0Verifier,
          typeOfLogin: 'jwt',
          clientId: auth0ClientId,
          logoDark: ''
          logoLight: ''
        },
      },
    },

  });
}

```

---

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [February 6, 2025, 8:13am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/4 "2025-02-06T08:13:29Z")

</div>

> [@indirizzo722](#):
>
> `this.web3authInstance.enableMFA()`

Please pass the same login params that you’re passing to `ConnectTo()`

```js
const mfa = await this.web3authInstance.enableMFA({
        loginProvider: "jwt",
        extraLoginOptions: {
          domain: auth0Domain,
          verifierIdField: 'sub',
        },
     });

```

 ![](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/4bea15d5fdfd372b2e7fae21263c61fab3da9379.png)

```
  <a href="https://web3auth.io/docs/sdk/pnp/web/no-modal/usage#enable-multi-factor-authentication-mfa" target="_blank" rel="noopener">web3auth.io</a>

```

### [Using PnP Web No Modal SDK | Documentation | Web3Auth](https://web3auth.io/docs/sdk/pnp/web/no-modal/usage#enable-multi-factor-authentication-mfa)

Web3Auth PnP Web No Modal SDK - Usage | Documentation - Web3Auth

---

<div class="post-metadata">

**Author:** ![indirizzo722](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@indirizzo722](https://builder.metamask.io/u/indirizzo722)\
**Post date:** [February 10, 2025, 9:31am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/5 "2025-02-10T09:31:43Z")

</div>

I receive the same error

```auto
  async enableMFA(): Promise<void> {
    if (this.web3authInstance) {
      const mfa = await this.web3authInstance.enableMFA({
        loginProvider: "jwt",
        domain: auth0Domain,
        extraLoginOptions: {
          domain: auth0Domain,
          verifierIdField: 'sub',
        }
      })
      console.log(mfa)
    }
  }

```

[![Screenshot 2025-02-10 alle 10.32.09](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/3b40b9203a43177237fc83b1c5a865b185f51660.jpeg)
Screenshot 2025-02-10 alle 10.32.091226×1468 112 KB
](https://web3auth.io/community/uploads/default/original/2X/3/3512e0c1b4d48982b8c84235c03b092ff10a84a9.jpeg "Screenshot 2025-02-10 alle 10.32.09")

[![Screenshot 2025-02-10 alle 10.31.49](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/ca0609089539e14f0135e99c486587f585e643bc.png)
Screenshot 2025-02-10 alle 10.31.491640×1042 36.1 KB
](https://web3auth.io/community/uploads/default/original/2X/2/25d729b314563ef289337138cf3fe9ca1e24a36e.png "Screenshot 2025-02-10 alle 10.31.49")

In console log:

Error: Invalid params for jwt login. Missing domain: traceId: undefined - spanId: undefined

---

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [February 11, 2025, 11:25am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/6 "2025-02-11T11:25:30Z")

</div>

Which login method are you using on Auth0 Modal?

---

<div class="post-metadata">

**Author:** ![indirizzo722](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@indirizzo722](https://builder.metamask.io/u/indirizzo722)\
**Post date:** [February 11, 2025, 4:51pm UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/7 "2025-02-11T16:51:31Z")

</div>

I’m using google and email/password

```auto
// Get openlogin adapter by provider
export const getOpenloginAdapterByProvider = (): AuthAdapter => {
  return new AuthAdapter({
adapterSettings: {

  network: web3AuthNetwrok,
  uxMode: 'redirect',
  whiteLabel: {
    logoDark: 'logo-dark.png', // TODO: CHANGE
    logoLight: 'logo-light.png', // TODO: CHANGE
    appName: '',
    appUrl: 'h', // TODO: CHANGE
    defaultLanguage: 'en',
    theme: {
      primary: '#000000',
    },
    useLogoLoader: true,
  },

  loginConfig: {

    jwt: {
      verifier: auth0Verifier,
      typeOfLogin: 'jwt',
      clientId: auth0ClientId,
      logoDark: 'logo-dark.png', // TODO: CHANGE
      logoLight: 'logo-light.png', // TODO: CHANGE
    },
  },
},

});
}
async initWeb3Auth(): Promise<> {
try {
const chainConfig = getChainConfig();
const privateKeyProvider = getPrivateKeyProviderByConfig(chainConfig);
const web3authInstance = getWeb3AuthNoModalByConfig(chainConfig, privateKeyProvider);
  const openloginAdapter = getOpenloginAdapterByProvider();

  web3authInstance.configureAdapter(openloginAdapter);
  await web3authInstance.init();

} catch {}}
async login(): Promise<> {
  if (!this.web3authInstance) {
    throw new Error("Web3Auth not initialized. Please initialize it before logging in.");
  }

  // logout if already connected
  if (this.web3authInstance?.connected) {
    await this.web3authInstance.logout();
  }

  // Connect to the Web3Auth adapter
  const web3authProvider = await this.web3authInstance.connectTo(WALLET_ADAPTERS.AUTH, {
    loginProvider: "jwt", // Specify the login provider (e.g., "jwt" for custom JWT-based login)

    extraLoginOptions: {
      domain: auth0Domain,
      verifierIdField: 'sub',

    },
  });

}
async enableMFA(): Promise<void> {
if (this.web3authInstance) {
const mfa = await this.web3authInstance.enableMFA({
loginProvider: “jwt”,
extraLoginOptions: {
domain: auth0Domain,
verifierIdField: ‘sub’,
}
})
console.log(mfa)
}
}

```

You can check my auth0 method on loginConfig

---

<div class="post-metadata">

**Author:** ![indirizzo722](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@indirizzo722](https://builder.metamask.io/u/indirizzo722)\
**Post date:** [February 14, 2025, 7:43am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/8 "2025-02-14T07:43:49Z")

</div>

Hey, any news for me?

---

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [February 18, 2025, 5:03am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/9 "2025-02-18T05:03:55Z")

</div>

Hi @indirizzo722,

We have successfully reproduced the issue on our end and have shared it with our product team for further investigation.

One approach that seems to work for enabling MFA is passing the idToken. However, for this to work with Auth0, you will need to allow login separately and extract the idToken, which is a more complicated process. We will follow up with you once we have an update.

---

<div class="post-metadata">

**Author:** ![indirizzo722](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@indirizzo722](https://builder.metamask.io/u/indirizzo722)\
**Post date:** [February 26, 2025, 10:12am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/10 "2025-02-26T10:12:32Z")

</div>

There are any news?  
I need to go on production in the next month with that functionality.

Thank you

---

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [February 26, 2025, 10:26am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/11 "2025-02-26T10:26:09Z")

</div>

Hi @indirizzo722,

We tested it on our end and could reproduce the issue. We’ve informed the team and will get back to you once we have an update.

Thank you

---

<div class="post-metadata">

**Author:** ![indirizzo722](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@indirizzo722](https://builder.metamask.io/u/indirizzo722)\
**Post date:** [March 5, 2025, 9:24am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/12 "2025-03-05T09:24:10Z")

</div>

Hi, how is the fixing of this issue going?

Thank you

---

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [March 6, 2025, 2:43am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/13 "2025-03-06T02:43:19Z")

</div>

Hey @indirizzo722

No update for now, will ping the team again today.

Thank you for your patience.

---

<div class="post-metadata">

**Author:** ![indirizzo722](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@indirizzo722](https://builder.metamask.io/u/indirizzo722)\
**Post date:** [March 19, 2025, 10:25am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/14 "2025-03-19T10:25:56Z")

</div>

Hey, any news?

Thanks

---

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [March 25, 2025, 9:31am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/15 "2025-03-25T09:31:37Z")

</div>

Hey @indirizzo722

One of the engineers is taking a look today. Will keep you posted.

---

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [March 27, 2025, 3:36am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/16 "2025-03-27T03:36:39Z")

</div>

Hey @indirizzo722

It will work if you try setting the domain while setting up the adapter. Check this code for reference:

```
  <a href="https://github.com/Web3Auth/web3auth-pnp-examples/blob/main/web-no-modal-sdk/custom-authentication/single-verifier-examples/auth0-no-modal-example/src/App.tsx#L40-L47" target="_blank" rel="noopener">github.com</a>

```

#### [Web3Auth/web3auth-pnp-examples/blob/main/web-no-modal-sdk/custom-authentication/single-verifier-examples/auth0-no-modal-example/src/App.tsx#L40-L47](https://github.com/Web3Auth/web3auth-pnp-examples/blob/main/web-no-modal-sdk/custom-authentication/single-verifier-examples/auth0-no-modal-example/src/App.tsx#L40-L47)

```
<pre class="onebox"><code class="lang-tsx">
  <ol class="start lines" start="40" style="counter-reset: li-counter 39 ;">
      <li>jwt: {</li>
      <li> verifier: "w3a-auth0-demo",</li>
      <li> typeOfLogin: "jwt",</li>
      <li> clientId: "hUVVf4SEsZT7syOiL0gLU9hFEtm2gQ6O",</li>
      <li> jwtParameters: {</li>
      <li> domain: "https://web3auth.au.auth0.com",</li>
      <li> verifierIdField: "sub",</li>
      <li> },</li>
  </ol>
</code></pre>

```

---

<div class="post-metadata">

**Author:** ![indirizzo722](https://avatars.discourse-cdn.com/v4/letter/i/e19adc/32.png) [@indirizzo722](https://builder.metamask.io/u/indirizzo722)\
**Post date:** [March 28, 2025, 9:12am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/17 "2025-03-28T09:12:07Z")

</div>

It works!  
But if I log in with a social account, I find the email pre-filled with my ID…

[![Screenshot 2025-03-28 alle 10.10.24](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/52d4aded93d04e8d92bec755671b3c9634a5ba24.png)
Screenshot 2025-03-28 alle 10.10.241036×906 38.5 KB
](https://web3auth.io/community/uploads/default/original/2X/e/e961fcf72f268e04275c0eff98fbc2eb41ca69da.png "Screenshot 2025-03-28 alle 10.10.24")

---

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [April 3, 2025, 2:57am UTC](https://builder.metamask.io/t/enablemfa-with-auth0-jwt/1059/18 "2025-04-03T02:57:08Z")

</div>

Hey @indirizzo722

Do you want this Auth0 Modal to appear so your users can select the login option? If not, you can bypass this screen by passing a connection to the jwtParameters.

> [@shahbaz](#):
>
> ```auto
> jwtParameters: {
> domain: "https://web3auth.au.auth0.com",
> verifierIdField: "sub",
> connection: "google-oauth2"
> },
> 
> ```
