Repository navigation
Description
Description
When upgrading my Keycloak 20 to v25 (I know, that was late) using the official Docker images, SSO with Kerberos stopped working.
TL;DR: The default /etc/krb5.conf is not provided in the image since Keycloak 21 which was necessary for our configuration.
I think you should
- either provide a default
/etc/krb5.confand/etc/krb5.conf.d/crypto-policies(as it was before) - or documented the necessity to add those files in the migration guide (for Keycloak 21)
- or install the
krb5-libslibrary in the image
Discussion
No response
Motivation
- I need to ensure compatibility with an old Kerberos server using the RC4-HMAC algorithm
- To achieve this I created a custom image based on yours, which adds a
crypto-policiesfile to/etc/krb5.conf.d/allowing weak algorithms - This worked fine in Keycloak 20 - but does not work anymore in Keycloak 25
Details
I have analyzed the problem and found the reason:
- Since Keycloak 21 you seem to use Red Hat's UBI micro image as base image (see this Dockerfile)
- Previously you used the UBI minimal image (see this earlier commit where you switched from
ubi8-minimaltoubi8-micro) - Unfortunately the micro image variant does not include the package
krb5-libs- compare packages in ubi9 micro and ubi9 minimal
- As far as I know it's exactly the
krb5-libspackage which includes the default/etc/krb5.conffile with directiveincludedir /etc/krb5.conf.d/and some reasonable[libdefaults]settings (for example look at the Source RPM here)
The full krb5-libs package is probably not required to have working Kerberos support in Keycloak.
It seems to suffice to add back the files /etc/krb5.conf and /etc/krb5.conf.d/crypto-policies.
The /etc/krb5.conf will be picked up by Java when trying to login with Kerberos authentication.
My solution
My personal solution was to copy the (missing) original /etc/krb5.conf and extend the Dockerfile to include this in my derived Keycloak 25 image. The default krb5.conf can be found in the Source RPM linked on this page.
Metadata
Metadata
Assignees
Labels
Type
Fields
Value
Effort
Votes
Activity
[-]Provide default krb5.conf or extend migration docs[/-][+]Provide default krb5.conf in Docker image or extend migration docs[/+]oers commentedon Jun 20, 2025
I'm affected by this as well. Maybe it would be a great idea to provide a docker image where the freeipa keycloak client is installed.
ASzc commentedon Jan 20, 2026
Adding the whole krb5-libs package isn't feasible because of its dependency on openssl. My recommendation in previous cases was to install krb5-libs when customizing the image. I had assumed that JNA was used to access krb5-libs binaries, but apparently JGSS provides the needed functionality, only depending on its customary config files.
Adding in the default config files is feasible since they have no dependencies themselves, but I am surprised that they would be useful? You didn't configure any realm information?
If realm configuration is required, I would prefer to solve this via documentation. If customization is required anyway, then there's no point hacking krb5.conf into the keycloak image by itself
hwanders commentedon Jan 25, 2026
@ASzc The default
krb5.confcontainsincludedir /etc/krb5.conf.d/- so people can place custom config files in that folder without touching thekrb5.conffile. That's why some setups don't require a customizedkrb5.conf, maybe they don't even knew about that file and were surprised when it was missing.ASzc commentedon Jan 26, 2026
Ok. I think this is best solved with a docs update then. Migration guide should mention it, and perhaps there's a spot in the main documentation this should be discussed too.
ASzc commentedon Jan 26, 2026
Please see PR #45764
18 remaining items
Clarify documentation of OS-level dependencies for Kerberos (keycloak…