Repository navigation
KC_HOSTNAME v2 implementation not backwards compatible with v1 #37219
Replies: 3 comments 7 replies
There is documentation on the migration, but it may not be completely descriptive for your particular case: https://www.keycloak.org/docs/latest/upgrading/index.html#migrating-to-25-0-0 If you do not want Keycloak to also redirect to hostname, then you need to use hostname-strict=false, so what you have is just:
Also:
Also you may eventually want to set proxy-headers - otherwise when the proxy is using a different port, path, or protocol than what the keycloak server is using you should see CORS check failures. |
|
Hi Steven, Thank you for the answer! I believe The variable |
|
For completeness - if the non-hostname requests are strictly for backchannel endpoints, then one can also use hostname-backchannel-dynamic=true with the hostname set. |
- Italic
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
We are in the process of upgrading our Keycloak setup from version 24.0.4 to 25.0.6. This version introduces the v2 implementation of the hostname configuration. We noticed some changes in behavior compared to v1.
At this moment we have set the KC_HOSTNAME property which worked perfectly fine (in real environments, this is configured with the public facing URL of Keycloak which is set up via an Ingress) .
Next to Keycloak, we have a custom sidecar container that does some API calls to Keycloak for creating realms and clients. This container accesses the Keycloak API directly so not via the configured KC_HOSTNAME (it’s deployed in the same k8s namespace and has access to it via a k8s service).
After upgrading to Keycloak 25, this setup is broken as Keycloak does a redirect to the configured KC_HOSTNAME which it doesn’t have access to.
I couldn’t find anything in the documentation that describes how I should migrate to the Hostname v2 implementation while retaining the behavior of v1.
Here is an example of the config we use:
The sidecar container is configured to call the keycloak container via
http://keycloak.svc.cluster.local:8080inside the k8s cluster.All reactions