jaatin
jaatin

Reputation: 1

Auth0 allowed callback URL not working as expected

I'm using Auth0 as auth for my express project. The express-openid-connect SDK to be precise.

my config:

const config = {
  authRequired: false,
  auth0Logout: true,
  secret: process.env.SECRET,
  baseURL: 'http://localhost:3000/',
  clientID: process.env.CLIENT_ID ,
  issuerBaseURL: process.env.ISSUER_BASEURL,
  
  
};

After a successful login , I want to redirect the use to http://localhost:3000/ (landing page).

In the Auth0 app dashboard , I set the allowed callback URl as http://localhost:3000/ which gives me an error : Callback URL mismatch. The provided redirect_uri is not in the list of allowed callback URLs.

But when i set the allowed callback URl as http://localhost:3000/callback , It works and redirects the user to http://localhost:3000 , even though I haven't explicitly mentioned it.

What is actually happening and why is Auth0 redirecting to http://localhost:3000 when the Allowed callback URI is set to http://localhost:3000/callback ?

Upvotes: 0

Views: 2221

Answers (1)

Tamil M
Tamil M

Reputation: 11

In the past, I also had similar issues when adding localhost to the callback urls. I believe Auth0 treats localhost:3000 and localhost:3000/ differently, so we had to add both versions, with and without trailing slash to the callback urls. If you have localhost:3000 in the client settings while having localhost:3000/ in the config as shown in screenshot, Auth0 might be blocking it because it only allows the root url without any paths

Upvotes: 0

Related Questions