[OID4VCI]: Fix getAttestationRequirements() for non-JWT proof types#50724
Open
Awambeng wants to merge 2 commits into
Open
[OID4VCI]: Fix getAttestationRequirements() for non-JWT proof types#50724Awambeng wants to merge 2 commits into
getAttestationRequirements() for non-JWT proof types#50724Awambeng wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes OID4VCI attestation validation so key_attestations_required is read from the actual proof-type entry being validated (e.g., attestation) rather than always reading the jwt entry, aligning behavior with configured metadata and closing #50521.
Changes:
- Thread the proof-type key through
validateAttestationPayload(...)intogetAttestationRequirements(...). - Replace the hardcoded
ProofType.JWTlookup with.get(proofTypeKey), and remove the unused static import. - Add unit tests verifying correct lookup for both
jwtandattestation, plus missing/unsupported configuration cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| services/src/main/java/org/keycloak/protocol/oid4vc/issuance/keybinding/AttestationValidatorUtil.java | Fixes attestation requirements lookup to use the provided proof-type key instead of hardcoding jwt. |
| services/src/test/java/org/keycloak/protocol/oid4vc/issuance/keybinding/AttestationValidatorUtilTest.java | Adds coverage proving requirements are read from the correct proof-type entry and handles missing config gracefully. |
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.forms.BrowserFlowTest#testUserWithOneAdditionalFactorOtpSuccessorg.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredAndRefreshInTab1Keycloak CI - Forms IT (chrome) org.keycloak.testsuite.webauthn.AppInitiatedActionWebAuthnSkipIfExistsTest#processSetupTwice |
- Thread proofTypeKey through validateAttestationPayload() to getAttestationRequirements() - Replace the hardcoded .get(JWT) lookup with .get(proofTypeKey) - Remove the unused ProofType.JWT import - Add unit tests verifying attestation requirements are read for the correct proof type Closes keycloak#50521 Signed-off-by: Awambeng Rodrick <awambengrodrick@gmail.com>
Signed-off-by: Awambeng Rodrick <awambengrodrick@gmail.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes
getAttestationRequirements()to use the configured proof type instead of always reading thejwtconfiguration.Key changes
proofTypeKeythroughvalidateAttestationPayload()togetAttestationRequirements()ProofType.JWTlookup withproofTypeKeyProofType.JWTimportjwtandattestationproof types and missing configuration casesCloses #50521