# Mismatching error while using auth in Nextjs

**URL:** <https://community.auth0.com/t/mismatching-error-while-using-auth-in-nextjs/84649>\
**Category:** Get Help\
**Tags:** logincallback, callback-urls, callback, nextjs, auth0, login\
**Created:** [June 6, 2022, 12:06pm UTC](https://community.auth0.com/t/mismatching-error-while-using-auth-in-nextjs/84649 "2022-06-06T12:06:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emmanueluzoezie](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emmanueluzoezie/32/37829_2.png) [@Emmanueluzoezie](https://community.auth0.com/u/Emmanueluzoezie)\
**Post date:** [June 6, 2022, 12:06pm UTC](https://community.auth0.com/t/mismatching-error-while-using-auth-in-nextjs/84649/1 "2022-06-06T12:06:12Z")

</div>

![Screenshot (92)](https://global.discourse-cdn.com/auth0/original/3X/7/3/735091c6e2753d499f3862625f9e6591752067c3.png)

```auto
**"error": {
      "message": "Callback URL mismatch. https://'http://localhost:3000'/api/auth/callback is not in the list of allowed callback URLs",
      "oauthError": "Callback URL mismatch. https://'http://localhost:3000'/api/auth/callback is not in the list of allowed callback URLs. Please go to 'https://manage.auth0.com/#/applications/Y3r9QBWuQ0SVYRp0qoIAWywctOBJQSmi/settings' and make sure you are sending the same callback url from your application.",
      "payload": {
        "message": "Callback URL mismatch. https://'http://localhost:3000'/api/auth/callback is not in the list of allowed callback URLs",
        "code": "unauthorized_client",
        "status": 403,
        "name": "CallbackMismatchError",
        "authorized": [
          "http://localhost:3000/api/auth/callback"
        ],
        "attempt": "https://'http://localhost:3000'/api/auth/callback",
        "log_url": "https://manage.auth0.com/#/logs/"
      },
      "type": "callback-url-mismatch"
    }
  },**

```

 ![Screenshot (91)](https://global.discourse-cdn.com/auth0/original/3X/a/2/a23dcda84b1bcc6230c9fbeef81005d06bc083c5.png)

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [June 6, 2022, 6:28pm UTC](https://community.auth0.com/t/mismatching-error-while-using-auth-in-nextjs/84649/3 "2022-06-06T18:28:29Z")

</div>

Hi @Emmanueluzoezie ,

Welcome to the Auth0 Community!

Based on the error message,

message": “Callback URL mismatch. **https://‘[http://localhost:3000](http://localhost:3000)’/api/auth/callback**  
is not in the list of allowed callback URLs”,

Your code prepends an additional https:// and the [http://localhost:3000](http://localhost:3000) is quoted. I suggest you check your scripts to make sure the callback URL matches that’s configured in the setting, that is, [http://localhost:3000/api/auth/callback](http://localhost:3000/api/auth/callback).

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Emmanueluzoezie](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emmanueluzoezie/32/37829_2.png) [@Emmanueluzoezie](https://community.auth0.com/u/Emmanueluzoezie)\
**Post date:** [June 7, 2022, 6:07am UTC](https://community.auth0.com/t/mismatching-error-while-using-auth-in-nextjs/84649/4 "2022-06-07T06:07:26Z")

</div>

Thanks for your feedback but please how can i check my script, because am using the default configuration provided by Auth0.

here’s is the only code i wrote

```auto
import { handleAuth } from '@auth0/nextjs-auth0';
export default handleAuth()

```

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [June 7, 2022, 4:40pm UTC](https://community.auth0.com/t/mismatching-error-while-using-auth-in-nextjs/84649/5 "2022-06-07T16:40:02Z")

</div>

I suggest you [capture the complete login event as a HAR file](https://auth0.com/docs/troubleshoot/troubleshooting-tools/generate-and-analyze-har-files) and check from there.

If you could DM the HAR file to me, I will look into this further.

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [June 10, 2022, 6:07pm UTC](https://community.auth0.com/t/mismatching-error-while-using-auth-in-nextjs/84649/6 "2022-06-10T18:07:24Z")

</div>

Hi @Emmanueluzoezie ,

I tested the sample Auth0 Next.js Regular Web App and could log in successfully.

Here are the steps I did:

1. Create a Next.js Regular Web App.
2. Downloading the sample code from the quick start
3. Go to the project folder:  
a. run `npm install @auth0/nextjs-auth0`  
b. run the `openssl rand -hex 32` on the command line to generate a 32-bit long random value and add it to the `AUTH0_SECRET` field in the `.env.local` file  
c. in the `.env.loca`l file, AUTH0\_BASE\_URL = [http://localhost:3000](http://localhost:3000), instead of AUTH0\_BASE\_URL = ‘[http://localhost:3000](http://localhost:3000)’  
c. run `npm run dev`

Hope the details help!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 21, 2022, 3:45pm UTC](https://community.auth0.com/t/mismatching-error-while-using-auth-in-nextjs/84649/7 "2022-12-21T15:45:27Z")

</div>


