r/KeyCloak • u/freddyp91 • Sep 25 '26
Disabled User Message
I have a realm where users use x509 authentication to sign in..When a user gets disabled I would like to customize the message that they see. Currently it just shows "X509 certificate authentication's failed. User is disabled."
In the messages_en.properties file i have tried setting the accountDisabledMessage field and this does not seem to change this message at all for me.
Anyone know how to target this field while using x509 authentication?
TIA

2
Upvotes
3
u/AVIAIT Sep 25 '26
"X509 certificate authentication's failed." and "User is disabled" are composed inside the X.509 authenticator itself (org.keycloak.authentication.authenticators.x509.X509ClientCertificateAuthenticator / ValidateX509CertificateUsername in keycloak-services). accountDisabledMessage belongs to the username/password path, which is exactly why it has no effect here. In the base login theme the only X.509-related keys are doX509Login, clientCertificate, noCertificate, auth-x509-client-username-form-display-name and ...-help-text — there is no error-text key to override.
So you have two realistic options:
There's no config-only override for this (verified on 26.7.4). Probably worth filing an issue upstream.
1
u/triflingconcern Sep 29 '26
It actually doesn't look like that that one uses a properties value at all: https://github.com/keycloak/keycloak/blob/319d7c205add3606af5574c76980bc7a8a2c486f/services/src/main/java/org/keycloak/authentication/authenticators/x509/X509ClientCertificateAuthenticator.java#L135
It might be straightforward to put up a pull request for that, but in the interim you you could add a bit of custom JS in the theme to swap out that content. A bit hacky, I know.