Auth0 Home Blog Docs

Auth0 callback only works in development for my Angular 2 (4) app

angular-2
auth0
callback-urls

#1

When I test my Angular 4 login with Auth0 in development mode with localhost:4000/callback as redirectUri for my auth0.WebAuth it works fine.

However, when I go to production, with redirectUri = https://example.com/my/app/callback then I get the following error from the console log

GET https://example.com/my/app/callback 404 (Not Found)

Any ideas?


#2

You need to ensure that your callback route is defined and available in your production environment. It would also be worth checking the Logs in Auth0 to see if any other errors were thrown.


#3

Is the callback route any different in the production environment other than replacing localhost with example.com?
Also, the logs looks to be “Success login”, so it might not be a problem with the auth, but with my app.


#4

My response was aimed at your application - you need to make sure that your callback route is working in your application, in your production environment.


#5

After some testing and googling I have landed on this being a server issue for routing and deep linking. Please see this stackoverflow for details:

https://stackoverflow.com/questions/34816025/angular2-routing-deep-linking-not-working-with-apache-404


#6