We are using Auth0 for authentication and NGINX for reverse proxy.
com.auth0.AuthenticationController is used at backend for the login and we updated all the setting at auth0 application and added these urls (http://localhost:8888, http://localhost:9999 ) to allowed callback urls list.
Nginx reverse proxy configuration
server {
listen 8888;
server_name localhost;
location = /login {
proxy_pass http://localhost:9999/login;
}
}
As per the above code when nginx gets login request it redirects it to http://localhost:9999/login
The service running at localhost:9999 is trying to get com.auth0.Token using the auth code
authenticationController.handle(request, response);
but following exception is thrown.
The redirect URI is wrong. You sent http://localhost:9999, and we expected http://localhost:8888
Note: It is telling us that while creating the secret code at Auth0 we have provided http://localhost:8888 as redirect_uri, but trying to access the token using http://localhost:9999
How to tell the Auth0 server that it is proxied url?