Repository navigation
Description
Description
AttestationBasedClientAuthenticator (feature client-auth-abca) resolves the Wallet Provider (attester) signing key only through the kid JOSE header, looked up in the JWKS of the trust-material identity providers listed in attester_trust_idps.
A Client Attestation JWT that carries its signing certificate chain in the x5c JOSE header and no kid is rejected before any verification takes place, with Invalid attester kid: null. The x5c header is never read.
This enhancement asks for a second resolution path: when x5c is present, validate the chain against X.509 trust anchors configured on the trust-material identity provider (the mechanism introduced by #51042 for key attestations), and use the leaf certificate's public key to verify the attestation signature.
Discussion
No existing discussion. Closest related issues: #43400 ("Verify that wallet attestations are signed by a trusted entity"), #48270 (TODOs review in the authenticator), #44772 (UI for trust configuration). None of them mention x5c resolution.
Motivation
Specifications
-
draft-ietf-oauth-attestation-based-client-auth-10(2026-07-06), §9.8, lists three ways for the Authorization Server to resolve the attester key, and namesx5cfirst:The
x5cheader parameter conveys an X.509 certificate chain in the JOSE header of each Client Attestation. Trust is established by validating the chain against a configured trust anchor.The authenticator's Javadoc references draft -07, where key discovery was out of scope.
-
OpenID4VCI 1.0, Annex E: "The Authorization Server MUST verify that the Wallet Attestation is signed by an issuer that the Credential Issuer trusts for this purpose" — no constraint on
kidvsx5c. -
The European WE BUILD conformance profile for credential issuance (CS-01 v1.3, §7.4) requires it on both sides:
- Wallet: "Convey the Wallet Provider signing certificate in the
x5cJOSE header of the WIA, with intermediate certificates as needed. The Wallet Provider identity is inferred from this certificate;issis not used." - Issuer: "Verify the WIA signature under the signing certificate in the
x5cJOSE header, and verify that this certificate chains to a trust anchor on the Trusted List for Wallet Providers, usingx5cintermediate certificates as needed."
- Wallet: "Convey the Wallet Provider signing certificate in the
Practical impact
The reference wallet of the WE BUILD interoperability test bed sends a Client Attestation with x5c and no kid. A Keycloak issuer therefore cannot pass the token-endpoint test cases of that profile, although the wallet is compliant with both the profile and the latest IETF draft.
Internal inconsistency
Since #51042 (release/26.8.0), Keycloak already validates x5c chains for key attestations at the credential endpoint: TrustMaterialIdentityProvider gained resolveX509Trust(...) / validateX509Chain(...), DefaultTrustIdentityProvider gained useX509 / trustedCertificates / requiredExtendedKeyUsages, and org.keycloak.crypto.X509CertificateChainValidator does the PKIX validation. AttestationBasedClientAuthenticator did not change (same file on main and on 26.7.0) and TrustMaterialRequest does not carry the chain, so the same trust configuration cannot be reused for client attestations — not even by a custom TrustMaterialIdentityProvider.
Details
Current behaviour (26.7.0, unchanged on 26.7.3 and main as of 2026-09-14)
services/src/main/java/org/keycloak/authentication/authenticators/client/AttestationBasedClientAuthenticator.java:
findAttesterKey(context, kid, algorithm, issuer)throwsIllegalArgumentException("Invalid attester kid: " + kid)whenkidis empty;jws.getHeader().getX5c()is never called;isConfigurable()returnsfalse,getConfigProperties()is empty; the only per-client property isattester_trust_idps— nothing can switch to another resolution.
Proposed change
In validateClientAttestationJwt:
- if
jws.getHeader().getX5c()is non-empty, resolve the key throughTrustMaterialResolver.validateX509Chain(session, attesterTrustIdps, request, x5c, alg)(the [OID4VCI] Harden key attestation x5c certificate validation #51042 path), i.e. against thetrustedCertificates/ EKU of the configureddefault-trustidentity providers; use the validated leaf public key; - otherwise keep the current
kid/ JWKS path; - fail with
invalid_client_attestationwhen neither resolves.
When both kid and x5c are present, prefer x5c (the WE BUILD profile states the attester identity is inferred from the certificate).
Suggested test: extend OIDCAttestationBasedClientAuthenticationTest with an attester whose attestation carries an x5c chain rooted at a default-trust identity provider configured in X.509 mode, and a negative case with an unchained certificate.
How to reproduce
- Keycloak 26.7.x, feature
client-auth-abcaenabled, a confidential client withclientAuthenticatorType = attestation-basedandattester_trust_idpspointing to adefault-trustidentity provider. - Send a Client Attestation JWT (
typ: oauth-client-attestation+jwt) whose JOSE header containsx5cand nokid, with a valid PoP JWT, to the token endpoint. - Response:
400 invalid_client_attestation; server log:Invalid attester kid: null.
Related
Epic #43136 · #44768 · #43400 · #48270 · #44772 · #48268 · PR #51042 (#50518, #50399, #51399)
Metadata
Metadata
Assignees
Labels
Type
Fields
Projects
- StatusShow more project fieldsDone
Activity
mposolda commentedon Sep 17, 2026
Added as a child to the
abcaepic. May need to be reviewed...Resolve ABCA attester key from x5c JOSE header
Resolve ABCA attester key from x5c JOSE header
Resolve ABCA attester key from x5c JOSE header
Resolve ABCA attester key from x5c JOSE header
Resolve ABCA attester key from x5c JOSE header
Resolve ABCA attester key from x5c JOSE header
keycloak-github-bot commentedon Oct 5, 2026
Due to the amount of issues reported by the community we are not able to prioritise resolving this issue at the moment.
If you are affected by this issue, upvote it by adding a 👍 to the description. We would also welcome a contribution to fix the issue.
Resolve ABCA attester key from x5c JOSE header
Resolve ABCA attester key from x5c JOSE header