You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keycloak 26.4 returns a different error response on a token request without Client Assertion (private_key_jwt client authentication) from Keycloak 26.3 does #43269
I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
oidc
Describe the bug
When a client using private_key_jwt as its client authentication method send a token request without Client Assertion, Keycloak 26.4.0 returns a error response, but this response is different from the one by Keycloak 26.3.
Due to this issue, Keycloak 26.4.0 cannot pass OIDF conformance tests while Keycloak 26.3 can pass.
Version
26.4.0
Regression
The issue is a regression
Expected behavior
Keycloak 26.3.5 can pass this OIDF conformance test, therefore, the following token response from the token endpoint of Keycloak 26.3.5 is a right response:
response_status_code: 400 BAD_REQUEST
response_status_text: Bad Request
response_body:
{"error":"invalid_client","error_description":"Parameter client_assertion_type is missing"}
Actual behavior
Keycloak 26.4.0 cannot this OIDF conformance test. The token response from Keycloak 26.4.0 is as follows:
response_status_code: 400 BAD_REQUEST
response_status_text: Bad Request
response_body:
{"error":"unauthorized_client","error_description":"Unexpected error when authenticating client"}
How to Reproduce?
As a client authentication method, private_key_jwt is set to a client.
This client send a token request without Client Assertion (instead, adding client_id parameter) to a token endpoint of Keycloak.
Anything else?
The error response is changed, so it might be considered as breaking change.
Due to this issue Keycloak 26.4.0 cannot pass the following OIDF conformance testing:
FAPI 1.0 Advanced Final (w/ private_key_jwt as client authentication method)
FAPI 2.0 Security Profile Final (w/ private_key_jwt as client authentication method))
FAPI 2.0 Message Signing Final (w/ private_key_jwt as client authentication method)
FAPI 2.0 Security Profile Implementer’s Draft version 2 (w/ private_key_jwt as client authentication method)
FAPI 2.0 Message Signing Implementer’s Draft version 1 (w/ private_key_jwt as client authentication method)
FAPI-CIBA (w/ private_key_jwt as client authentication method)
UK Open Banking (w/ private_key_jwt as client authentication method)
Australia Consumer Data Right (w/ private_key_jwt as client authentication method)
Open Finance Brazil (w/ private_key_jwt as client authentication method)
@tnorimat Thank you, Takashi, for identifying this and creating the issue.
@tnorimat@thomasdarimont@francis-pouatcha@mposolda@stianst : I’d like to propose that we prioritise maintaining OpenID conformance as a key part of Keycloak’s release assurance. We’re seeing an increasing number of financial institutions adopting Keycloak for their FAPI and Open Banking use cases. Any regressions in conformance can lead to significant challenges, from broken third-party provider (TPP) integrations to potential regulatory implications for these institutions.
To provide confidence to our adopters that new Keycloak versions won’t break existing conformance, I suggest implementing an automated test workflow that triggers either post-merge to main & supported version branches or on a nightly schedule. This workflow would automatically run the OpenID conformance tests and create issues for any failures detected, ensuring timely visibility and resolution. I hope this would strengthen Keycloak’s reliability for critical use cases and demonstrate our commitment to standard conformance and interoperability.
Activity
VinodAnandan commentedon Oct 7, 2025
@tnorimat Thank you, Takashi, for identifying this and creating the issue.
@tnorimat @thomasdarimont @francis-pouatcha @mposolda @stianst : I’d like to propose that we prioritise maintaining OpenID conformance as a key part of Keycloak’s release assurance. We’re seeing an increasing number of financial institutions adopting Keycloak for their FAPI and Open Banking use cases. Any regressions in conformance can lead to significant challenges, from broken third-party provider (TPP) integrations to potential regulatory implications for these institutions.
To provide confidence to our adopters that new Keycloak versions won’t break existing conformance, I suggest implementing an automated test workflow that triggers either post-merge to main & supported version branches or on a nightly schedule. This workflow would automatically run the OpenID conformance tests and create issues for any failures detected, ensuring timely visibility and resolution. I hope this would strengthen Keycloak’s reliability for critical use cases and demonstrate our commitment to standard conformance and interoperability.
thomasdarimont commentedon Oct 8, 2025
In Keycloak 26.3.5 JWTClientAuthenticator explicitly called
validator.clientAssertionParametersValidation()https://github.com/keycloak/keycloak/blob/26.3.5/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientAuthenticator.java#L67
The method:
https://github.com/keycloak/keycloak/blob/26.3.5/services/src/main/java/org/keycloak/authentication/authenticators/client/JWTClientValidator.java#L79
is now missing in Keycloak 26.4.0 (got refactored to a simple presence check without throwing an error). This is the cause of the issue.
This can be tested by creating a client with Signed JWT Auth and client_credentials grant:
thomasdarimont commentedon Oct 8, 2025
Perhaps we can just add the method again. Do we need the same logic for the Spiffe functionality?
thomasdarimont commentedon Oct 8, 2025
I added PR #43281 with a fix.
With this the proper error is returned:
thomasdarimont commentedon Oct 8, 2025
I was wondering why this bug wasn't detected by this test org.keycloak.testsuite.oauth.ClientAuthSignedJWTTest#testMissingClientAssertionType
See:
https://github.com/keycloak/keycloak/blob/main/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/ClientAuthSignedJWTTest.java#L422
It turns out those tests don't send a client_id in the request and therefore the actual error is never triggered...
Ensure conformance for Signed JWT Validation (keycloak#43269)
2 remaining items
Ensure conformance for Signed JWT Validation (keycloak#43269)
Ensure conformance for Signed JWT Validation + tests (keycloak#43269)
Use correct error response for missing assertions in Signed JWT Valid…
Ensure conformance for Signed JWT Validation