Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation is backward compatible, correctly validated, and adequately tested.
Review effort: Balanced
Findings: None
What changed in this PR
Adds optional ETSI-compliant enforcement that JWT proof keys occupy attested_keys[0], while preserving existing membership validation by default.
Changes:
- Adds and validates the proof-key-index credential setting.
- Enforces positional proof-key validation with clearer errors.
- Adds unit and integration coverage for enforcement and compatibility.
| File | Description |
|---|---|
CredentialScopeModel.java |
Adds the typed configuration attribute. |
CredentialScopeRepresentation.java |
Exposes typed representation accessors. |
SupportedCredentialConfiguration.java |
Parses and validates the configured index. |
JwtProofValidator.java |
Enforces membership or index-zero matching. |
JwtProofValidatorTest.java |
Tests positional and backward-compatible validation. |
OID4VCKeyAttestationTest.java |
Tests configuration parsing and integrated enforcement. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
Unicode-whitespace proof key index values can be persisted and trigger NumberFormatException, breaking realm issuer discovery instead of being rejected with HTTP 400.
1 open issue
1 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
Thanks, the index check looks correct and the default behaviour is unchanged. Fine to merge as is. Two follow-ups:
1. Bind all attested keys. ETSI TS 119 472-3 (CRED-REQ-PROC-4.6.2.1-04) requires one credential per entry in attested_keys, and OpenID4VCI 1.0 F.1 recommends the same. ETSI also allows only one JWT proof. With this option on, a wallet therefore gets a single credential instead of a batch. The attestation proof type already returns all attested keys, and the JWT proof could do the same.
2. kid as an index. The example of a JWT proof with a key attestation in OpenID4VCI 1.0 F.1 has the header "kid": "0" and no jwk. The attested keys in the example in Appendix D.1 have no kid, so "0" refers to the position in attested_keys. The EUDI reference wallet sends exactly this. Keycloak looks for an attested key whose kid is "0" and rejects the proof before the index check runs. Reading kid as the position in attested_keys when a key attestation is present would fix this.
Thanks for the review, @dominikschlosser. I'll open a follow-up ticket to address your comments. |
- Add vc.key_attestation.proof_key_index to allow a credential configuration to require the proof signing key to be attested_keys[0], as required by ETSI TS 119 472-3 and Regulation (EU) 2026/1731. - If the option is not set, the existing membership check is kept for backwards compatibility. Closes keycloak#52786 Signed-off-by: Awambeng Rodrick <awambengrodrick@gmail.com>
Signed-off-by: Awambeng Rodrick <awambengrodrick@gmail.com>
|
Follow-up ticket created: #54634 |


This PR adds support for the ETSI TS 119 472-3 requirement that the proof signing key must be the first key in attested_keys for OID4VCI JWT proofs.
Key changes:
vc.key_attestation.proof_key_indexto credential configuration. When set to 0, the proof signing key must be attested_keys[0].Closes #52786