Repository navigation
Hostname configuration in production #20739
Closed
nicolas-goudry
started this conversation in
Archive
Replies: 1 comment
|
I think I found my answer by looking at the usage of It’s now working like before (I guess). I can authenticate in my applications through deployed Keycloak as well as establish a port-forward to the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
We were using Keycloak 16 since about 2 years and decided that it was time to migrate to the latest Keycloak. We did so without any major issues, but we have a problem with the hostname-related configuration.
We’re deploying Keycloak to Kubernetes on GKE (without the Operator because we don’t want any alpha resources in our cluster) and the following Ingress configuration to prevent access to the admin console from the public domain:
When we want to access the admin console, we create a port-forward to the
keycloakService and connect to the console fromlocalhost. This worked fine with Keycloak 16, but doesn’t work with Keycloak 21…I first tried to set the
KC_HOSTNAMEvariable tolocalhost, but then the authentication stopped working from the deployed domain because it was trying to load assets fromlocalhost…I then set the
KC_HOSTNAMEto the deployed domain nameauth.example.com, but it didn’t work as the assets were trying to be loaded fromauth.example.com:8443, which is not the port on which the Ingress is listening…The only configuration that worked is to set the
KC_HOSTNAME_URLtohttps://auth.example.com. But it breaks our port-forward for two reasons:/realms/master/*path (as seen in the Ingress config), which effectively breaks the admin console as it tries to load/realms/master/protocol/openid-connect/3p-cookies/step1.htmlfromauth.example.com(we get an expected 404 on this path)/realms/main/*to/realms/*), assets succeed to load but the console is stuck on « Loading the Admin UI » with a 403 Forbidden trying to load/realms/master/protocol/openid-connect/login-status-iframe.html/init?client_id=security-admin-console&origin=https%3A%2F%2Flocalhost%3A9999(my port-forward is on port 9999)I tried to set the
KC_HOSTNAME_ADMINtolocalhostbut it didn’t work either… I also added a web origin ofhttps://localhost:9999to thesecurity-admin-consoleclient of themasterrealm, without success.Any clues on how to reproduce the legacy behavior of Keycloak 16?
All reactions