-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bitnami/keycloak] is not allowing local hostname with port forwarding when Ingress also enabled #32832
Comments
Hi, Following annotation on ingress to block the Keycloak admin Ui and allowing the UI through port forwarding
|
Hi, Did the ingress annotation fix the issue? |
HI, Yes, it worked after removing KEYCLOAK_HOSTNAME in Keycloak Configuration and accepting front channel URL same as back channel also. For this, i have to keep KEYCLOAK_HOSTNAME_STRICT false. As per Keycloak document, Keycloak mandates the configuration of the hostname option and does not dynamically resolve URLs. This is a security measure How to prevent the security? |
Hi @knraju483, Please correct me if I misunderstood something. You would like to access your keycloak with both your ingress (keycoak.abc.net/auth) and port-forwarding (localhost), but Keycloak refuses localhost connections because it enforces KEYCLOAK_HOSTNAME and dynamically rewrites your requests. You would like to allow only auth API calls through the ingress while no restrictions through localhost (port-forward). The access issue is solved by setting I think the current Keycloak v2 does not have a native solution for this, but I was able to make get your setup working with a simple workaround.
Workaround: by setting I think this is the only way to have Keycloak hostname v2 configured and still be able to access using different URLs. If this workaround doesn't work your you, I would suggest asking in the keycloak support sources for an alternative, since I don't know if Keycloak natively supports your use case and it may not be related to the chart. |
Hi, Thanks a lot. this is really good solution to map the localhost instead but I have annotation ingress controller to block the Auth console. In this scenario, whether DNS resolve will happen from local or internet ? as I still need the DNS resolve over internet for API calls and Auth console from local host. Following annotation in Ingress controller to block the Admin console for Auth API. nginx.ingress.kubernetes.io/server-snippet: |- |
Hi @knraju483, Names configured at Then when you need to access the Auth Console, you can enable port-forward + /etc/hosts and access. From a networking perspective both routes are completely different:
The main disadvantage would be that you can not have both routes at the same time, because as I said |
Name and Version
bitnami/keycloak 26.0.7
What architecture are you using?
arm64
What steps will reproduce the bug?
Hi,
I need configurations for accepting Keycloak UI with Ingress and port forward at the same. I also disabled admin UI ingress for production and disabled access through normal ingress and it only allow auth API request.
Kindly help me on supporting both Ingress/port forwarding connection with local host.
Following my configuration for keycloak
Regards
Are you using any custom parameters or values?
No response
What is the expected behavior?
No response
What do you see instead?
I want to access the Keycloak Admin UI with portforwarding local host connection when I am disabled admin Ingress and annotation is added for normal ingress to block the access for UI and allow only for auth api requst.
Additional information
No response
The text was updated successfully, but these errors were encountered: