jhipster keycloak integration always redirect to localhost:8080


jhipster keycloak integration always redirect to localhost:8080



Angular/Spring app generated using jhipster
here's my app configs "application.yml"


Angular/Spring


application.yml


security:
oauth2:
client:
access-token-uri: http://test.com:9080/auth/realms/urms/protocol/openid-connect/token
user-authorization-uri: http://test.com:9080/auth/realms/urms/protocol/openid-connect/auth
client-id: urms
client-secret: urms
client-authentication-scheme: form
scope: openid profile email
resource:
user-info-uri: http://test.com:9080/auth/realms/urms/protocol/openid-connect/userinfo
token-info-uri: http://example.com:9080/auth/realms/urms/protocol/openid-connect/token/introspect
prefer-token-info: false



I deployed the application to my domain let's say "test.com" server.



Problem
Once user go to "/login" he will reach keycloak with redirection URL like


/login


http://test.com:9080/auth/realms/urms/protocol/openid-connect/auth?client_id=urms&redirect_uri=**http://localhost:8080**/login&response_type=code&scope=openid%20profile%20email&state=F2xa8S



Any idea why it's fixed to localhost:8080?


localhost:8080




1 Answer
1



Answering my question. The issue was that I am running nginx to proxy to spring server. What I needed is that I should adjust my configuration to set the following header "HOST" so it will be


location / {
proxy_set_header HOST $host;
proxy_pass http://localhost:8080;
}



Instead of simply using "proxy_pass" only






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Opening a url is failing in Swift

Export result set on Dbeaver to CSV