# Error while using next-auth (v4) with auth0 as provider

**URL:** <https://community.auth0.com/t/error-while-using-next-auth-v4-with-auth0-as-provider/97550>\
**Category:** Get Help\
**Tags:** other, sdks-quickstarts, nextjs-auth0\
**Created:** [January 5, 2023, 2:21pm UTC](https://community.auth0.com/t/error-while-using-next-auth-v4-with-auth0-as-provider/97550 "2023-01-05T14:21:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![funtyper](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/funtyper/32/42311_2.png) [@funtyper](https://community.auth0.com/u/funtyper)\
**Post date:** [January 5, 2023, 2:21pm UTC](https://community.auth0.com/t/error-while-using-next-auth-v4-with-auth0-as-provider/97550/1 "2023-01-05T14:21:45Z")

</div>

Hi,

Here is repo of my application

> **[GitHub - aqilzeeshan/next\_auth](https://github.com/aqilzeeshan/next_auth)**
>
> Contribute to aqilzeeshan/next\_auth development by creating an account on GitHub.

When I use for example github login directly with next-auth(v4) there is no problem so code is working fine but when I use auth0 then I get error as shown in the screenshot below.

 ![error_auth0](https://global.discourse-cdn.com/auth0/original/3X/e/a/ea56ea54c6743028d1ec90e3a8fc1961d2e56312.png)

Not sure what is the problem.

Please help. Thanks

---

<div class="post-metadata">

**Author:** ![funtyper](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/funtyper/32/42311_2.png) [@funtyper](https://community.auth0.com/u/funtyper)\
**Post date:** [January 5, 2023, 2:57pm UTC](https://community.auth0.com/t/error-while-using-next-auth-v4-with-auth0-as-provider/97550/2 "2023-01-05T14:57:56Z")

</div>

Based on [Auth0 | NextAuth.js](https://next-auth.js.org/providers/auth0)

I changed from

```
Auth0Provider({
  clientId: process.env.AUTH0_CLIENT_ID,
  clientSecret: process.env.AUTH0_CLIENT_SECRET,
  domain: process.env.AUTH0_ISSUER
})

```

to

```
Auth0Provider({
  clientId: process.env.AUTH0_CLIENT_ID,
  clientSecret: process.env.AUTH0_CLIENT_SECRET,
  issuer: process.env.AUTH0_ISSUER
})

```

That fixed the error.

---

<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:** [November 21, 2024, 7:08pm UTC](https://community.auth0.com/t/error-while-using-next-auth-v4-with-auth0-as-provider/97550/3 "2024-11-21T19:08:02Z")

</div>

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