8000 [OID4VCI-FAPI2] Pass fapi2-security-profile-final-dpop-negative-tests by tdiesler · Pull Request #50125 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

[OID4VCI-FAPI2] Pass fapi2-security-profile-final-dpop-negative-tests - #50125

Merged
mposolda merged 1 commit into
keycloak:mainfrom
tdiesler:ghi48070
Jun 26, 2026
Merged

mposolda merged 1 commit into
keycloak:mainfrom
tdiesler:ghi48070

Conversation

@tdiesler
@tdiesler tdiesler commented Jun 18, 2026 •
Copy link
Copy Markdown
Contributor

closes #48070

  • Extend OID4VC wallet test helper API to allow sending dpop_jkt on authorization requests.
  • Normalize DPoP htu comparison by stripping URI fragments (in addition to query) to match expected DPoP URL processing.
  • Harden DPoP proof header/JWK validation by rejecting missing alg and rejecting private-key material (d) in the embedded JWK.

@tdiesler
tdiesler requested a review from a team as a code owner June 18, 2026 14:32
Copilot AI review requested due to automatic review settings June 18, 2026 14:32
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Keycloak’s DPoP validation and OID4VC test utilities to satisfy the FAPI2 “final DPoP negative tests” expectations (issue #48070), tightening proof/JWK validation and aligning HTTP URI matching behavior.

Changes:

  • Extend OID4VC wallet test helper API to allow sending dpop_jkt on authorization requests.
  • Normalize DPoP htu comparison by stripping URI fragments (in addition to query) to match expected DPoP URL processing.
  • Harden DPoP proof header/JWK validation by rejecting missing alg and rejecting private-key material (d) in the embedded JWK.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
tests/base/src/test/java/org/keycloak/tests/oid4vc/OID4VCBasicWallet.java Adds a fluent helper to set dpop_jkt on authorization requests in OID4VC tests.
services/src/main/java/org/keycloak/services/util/DPoPUtil.java Tightens DPoP validation (URI normalization, alg presence check, reject JWK private-key parameter d).

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If 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.MultipleTabsLoginTest#expiredAuthenticationAction_expiredCodeExpiredExecution

Keycloak CI - Forms IT (chrome)

org.openqa.selenium.NoSuchElementException: 
no such element: Unable to locate element: {"method":"css selector","selector":"#password\-new"}
  (Session info: chrome=149.0.7827.114)
For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Build info: version: '4.28.1', revision: '73f5ad48a2'
...

Report flaky test

org.keycloak.testsuite.federation.kerberos.KerberosLdapTest#writableEditModeTest

Keycloak CI - Java Distribution IT (windows-latest - temurin - 21)

org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
...

Report flaky test

org.keycloak.testsuite.federation.kerberos.KerberosLdapTest#usernamePasswordLoginTest

Keycloak CI - Java Distribution IT (windows-latest - temurin - 21)

org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.keycloak.testsuite.federation.kerberos.AbstractKerberosSingleRealmTest.usernamePasswordLoginTest(AbstractKerberosSingleRealmTest.java:140)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.jboss.arquillian.junit.Arquillian$8$1.invokeMethod(Arquillian.java:319)
	at org.jboss.arquillian.junit.MethodInvoker$1.invoke(MethodInvoker.java:18)
...

Report flaky test

@tdiesler
tdiesler marked this pull request as draft June 19, 2026 07:03
@tdiesler
tdiesler marked this pull request as ready for review June 19, 2026 11:01
@tdiesler
tdiesler marked this pull request as draft June 22, 2026 11:40
@tdiesler
tdiesler marked this pull request as ready for review June 23, 2026 08:30
@tdiesler
tdiesler force-pushed the ghi48070 branch 2 times, most recently from ef268d5 to 3372c4f Compare June 23, 2026 14:44
Copilot AI review requested due to automatic review settings June 24, 2026 06:58
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings June 24, 2026 07:03
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

@mposolda mposolda left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tdiesler Thanks, added minor comment inline.

Also I wonder about some automated test for this, but not sure if you omit automated test on purpose as it is tricky to properly test this?

@@ -104,8 +106,18 @@ public enum Mode {
DISABLED
}

private static final Set<String> JWK_PRIVATE_KEY_PARAMETERS = Set.of(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use signatureProviderFactory..getJwkPrivateKeyClaims() method to retrieve names of private key claims dynamically? It is already used in the method JwtProofValidator.getPrivateClaimNames

Hardcoded claims are not ideal for few reasons... Especially we will need to add some support for post-quantum cryptography in the near future AFAIK, which would probably mean some additional algorithms supported and hence hardcoded list may cause some claims to be omitted (which might in theory have even security implications...).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, much better

@mposolda mposolda self-assigned this Jun 25, 2026
Copilot AI review requested due to automatic review settings June 26, 2026 08:15
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

closes keycloak#48070

Signed-off-by: Thomas Diesler <tdiesler@proton.me>

* Extend OID4VC wallet test helper API to allow sending dpop_jkt on authorization requests.
* Normalize DPoP htu comparison by stripping URI fragments (in addition to query) to match expected DPoP URL processing.
* Harden DPoP proof header/JWK validation by rejecting missing alg and rejecting private-key material (d) in the embedded JWK.
@mposolda mposolda left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tdiesler Thanks!

@mposolda
mposolda merged commit e30788e into keycloak:main Jun 26, 2026
88 checks passed
@tdiesler
tdiesler deleted the ghi48070 branch June 26, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OID4VCI-FAPI2] Pass fapi2-security-profile-final-dpop-negative-tests

4 participants

0