[OID4VCI] Implement Key-Binding for jwt-credentials and fix it for SD-JWT#49895
Conversation
9253dd1 to
59074e4
Compare
|
Thanks @wistefan, for the PR. It looks like the DCO checks are currently failing. Could you please take a look when you have a chance? |
59074e4 to
c902f05
Compare
Awambeng
left a comment
There was a problem hiding this comment.
Hi @wistefan,
Thanks for the PR. I have left a few minor comments, could you please take a look when you get a chance?
I also noticed that the commits are unverified and some CI checks are failing. Could you please check those as well?
Thanks!
| return this; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Could you please remove the extra whitespace?
| this.issuerSignedJWT = issuerSignedJWT; | ||
| } | ||
|
|
||
|
@mposolda Could you please help us with the review of this PR ? |
There was a problem hiding this comment.
Pull request overview
Implements holder key-binding for JWT credentials in OID4VCI issuance and fixes SD-JWT key-binding so the cnf claim is retained when default decoys are generated.
Changes:
- Implement key-binding for JWT credentials by adding a
cnf.jwkclaim at signing time. - Fix SD-JWT key-binding by treating
cnfas a visible SD-JWT claim rather than mutating the issuer payload directly. - Extend/adjust tests to validate presence of
cnfacross SD-JWT decoy configurations and for JWT credentials.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/base/src/test/java/org/keycloak/tests/oid4vc/issuance/signing/LDCredentialSignerTest.java | Updates test construction for JwtCredentialBody after API change. |
| tests/base/src/test/java/org/keycloak/tests/oid4vc/issuance/credentialbuilder/SdJwtCredentialBuilderTest.java | Adds parameterized coverage ensuring cnf survives with 0/default and explicit decoys. |
| tests/base/src/test/java/org/keycloak/tests/oid4vc/issuance/credentialbuilder/JwtCredentialBuilderTest.java | Adds test ensuring cnf.jwk is embedded into JWT credentials when key-binding is applied. |
| services/src/main/java/org/keycloak/protocol/oid4vc/issuance/credentialbuilder/SdJwtCredentialBody.java | Changes key-binding injection to add cnf as a visible SD-JWT claim. |
| services/src/main/java/org/keycloak/protocol/oid4vc/issuance/credentialbuilder/JwtCredentialBuilder.java | Adjusts builder to pass JsonWebToken into JwtCredentialBody so late mutations are signed. |
| services/src/main/java/org/keycloak/protocol/oid4vc/issuance/credentialbuilder/JwtCredentialBody.java | Implements JWT key-binding by writing cnf.jwk into the token’s other claims and signing the updated token. |
| core/src/main/java/org/keycloak/sdjwt/SdJwt.java | Refactors default-decoy handling so disclosure payload regeneration happens consistently. |
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
…redentialbuilder/SdJwtCredentialBody.java Co-authored-by: Awambeng <114798938+Awambeng@users.noreply.github.com> Signed-off-by: Stefan Wiedemann <stefan.wiedemann@seamware.com>
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Stefan Wiedemann <stefan.wiedemann@seamware.com>
82f037c to
770253f
Compare
mposolda
left a comment
There was a problem hiding this comment.
@wistefan @Awambeng @VinodAnandan @jordandunmire97-ai Thanks for this PR and for the reviews!
closes #49891
This PR: