# \[Error\] callback url

**URL:** <https://community.auth0.com/t/error-callback-url/101038>\
**Category:** Get Help\
**Tags:** login-prompt-new-experience, login-experience\
**Created:** [February 22, 2023, 2:25pm UTC](https://community.auth0.com/t/error-callback-url/101038 "2023-02-22T14:25:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JihooniiK](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jihooniik/32/44427_2.png) [@JihooniiK](https://community.auth0.com/u/JihooniiK)\
**Post date:** [February 22, 2023, 2:25pm UTC](https://community.auth0.com/t/error-callback-url/101038/1 "2023-02-22T14:25:45Z")

</div>

When I try to deploy the website (next.js) through Heroku, there is a connection refused error (“ERR\_CONNECTION\_REFUSED”). Also, sometimes I can see the error message “mismatched callback URLs”.

Also, I have no idea how to set the callback URL in the “allowed callback URLs” section. And how to set the Config Vars in Heroku.

Could you give me tips on how to set up when I deploy the website through Heroku?

 ![Screenshot 2023-02-22 at 11.16.35 PM](https://global.discourse-cdn.com/auth0/original/3X/4/a/4ae85d905d410997eaf364c3bb7fb3e56bff3632.png)  
 ![Screenshot 2023-02-22 at 11.23.29 PM](https://global.discourse-cdn.com/auth0/original/3X/e/c/ec660287ee382e0a00c411de90b57c702cf3a98f.png)

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 22, 2023, 6:45pm UTC](https://community.auth0.com/t/error-callback-url/101038/3 "2023-02-22T18:45:37Z")

</div>

Hey there @JihooniiK welcome to the community!

> [@JihooniiK](#):
>
> Also, I have no idea how to set the callback URL in the “allowed callback URLs” section. And how to set the Config Vars in Heroku.

You’ll definitely need to add a callback url to the allow list first and foremost - You can find more info on that [here](https://auth0.com/docs/authenticate/login/redirect-users-after-login#redirect-users-to-callback-urls-on-the-allowlist).

Regarding Heroku in particular, there could many potential issues, but as in Auth0 you’ll need to set config/environment variables accordingly. I recommend checking out the following thread first for ideas:

> [@Auth0 Integration With Heroku](https://community.auth0.com/t/auth0-integration-with-heroku/56115/9):
>
> Hi. I’m not sure if you still have the issue but what worked for me was adding missing env variables to Heroku. You can use the cli or go to applications → settings → reveal config variables and add your domain and client\_id. Also thanks for the help Stephanie if you’re reading this.

Hope this helps!

---

<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 9, 2023, 12:41am UTC](https://community.auth0.com/t/error-callback-url/101038/4 "2023-03-09T00:41:24Z")

</div>

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