Always redirected to homepage post authentication - Expressjs - express-openid-connect

I have successfully set-up Auth0 inside an Expressjs based site using express-openid-connect. I have also set “Allowed Callback URLs” and “Allowed Logout URLs” for the relevant application via the dashboard.

From what I understand “Allowed Callback URLs” is the list of URL to which Auth0 will send a user after they have successfully authenticated. I have only one URL configured here for example:

http://localhost:3000/profile

However, after successful authentication, I am always send to the landing page aka http://localhost:3000. If I for example try to directly access http://localhost:3000/profile, I am sent to the universal login page but, post authentication, I am again returned to http://localhost:3000

I have also added and entry such as the following to the config object in app.js

...
redirectUriPath: "/profile",
...

This unfortunately still yields the same end result. Has anyone else run into this same problem? Is there some piece of configuration that I am missing?

Thank you in advance for your assistance.

2 Likes

Having the exact same issue.

I looked at the redirect_uri GET parameter that is passed to the https://dev-myproject.auth0.com/login page (where you can select an authentication method) and indeed, the value of the redirectUriPath configuration setting is being passed along properly (&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fuser).

After successful authentication however I am redirected to http://localhost:8000, not http://localhost:8000/user. The value of the redirect_uri parameter appears to be disregarded.

Can anyone help?

3 Likes

Hi folks, Nick from the Product team here. This PR merged a few days ago should fix the issue you’re having: Fix returnTo on Login by davidpatrick · Pull Request #95 · auth0/express-openid-connect · GitHub

We’ll do a release shortly - within the next couple of days all going well - would you mind watching the releases and please let us know if you have further problems with redirect, after that: Releases · auth0/express-openid-connect · GitHub

2 Likes

Thanks so much for letting us know. I know you have a lot going on but, if you could put a ping in here once released that would be awesome.

Also, while you are here :slight_smile: Would you mind taking a look at this one as well:

Thanks so much

Thank you for the heads-up Nick!

Looking forward to testing the latest release.

1 Like

Will let you know once it’s there!

James the fix for this is now released in v1.0.2 Release v1.0.2 · auth0/express-openid-connect · GitHub

Thanks again for the report

1 Like

…and you can also Watch the Releases in the repo via feed Release notes from express-openid-connect or just via GitHub directly

wrt the other thread, the team will be able to take a look during the week.

1 Like

Hi Nick,

Updated express-openid-connect to v1.0.2 and do confirm that the issue has indeed been resolved.

Many thanks!

3 Likes

Glad to hear that it all came together! Let us know if you have any other questions down the road!

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