[keycloak-user] Invalid token issuer when running as docker service

Tom Braun braun.tom at web.de
Sat Jun 10 09:30:25 EDT 2017


Hello,

got the follwing setup:
- frontend (oauth, angular2)
- rest-backend (bearerOnly, spring-boot with spring-security)
- keycloak (standalone)

If I run the three as "ordinary" processes, everything works fine.
However, if I try to run them as services within a docker (swarm mode)
the rest-backend keeps complaining about:

org.keycloak.common.VerificationException: Invalid token issuer. 
Expected 'http://myhost:8180/auth/realms/myrealm', but was 
'http://localhost:8180/auth/realms/myrealm'


I inserted myhost into my /etc/hosts to point to the IP of docker0. So 
far it works, I can access the frontend on port 80 and keycloak on port 
8180.

Is there a way to make keycloak report as myhost in the issuer token and 
not as localhost?

Tried running keycloak behind a reverse-proxy - no change.





More information about the keycloak-user mailing list