Skip to content

[OID4VCI] align issuer metadata/encryption behavior and move encryption tests to base suite#48048

Merged
mposolda merged 6 commits intokeycloak:mainfrom
adorsys:oid4vci-conformace-1
Apr 24, 2026
Merged

[OID4VCI] align issuer metadata/encryption behavior and move encryption tests to base suite#48048
mposolda merged 6 commits intokeycloak:mainfrom
adorsys:oid4vci-conformace-1

Conversation

@forkimenjeckayang
Copy link
Copy Markdown
Contributor

@forkimenjeckayang forkimenjeckayang commented Apr 14, 2026

This is the very begining of sending small seperate PRs with fixes related to running OID4VCI Final conformance tests OpenID for Verifiable Credential Issuance 1.0 Final: Test an issuer agaist keycloak.

Summary

  • Move OID4VCIssuerEndpointEncryptionTest from the legacy integration testsuite location to tests/base.
  • Align OID4VCI issuer endpoint behavior and metadata handling with current OID4VCI final expectations, especially around request/response encryption semantics.
  • Update and stabilize related OID4VCI tests (OID4VCJWTIssuerEndpointTest, OID4VCIssuerWellKnownProviderTest) and resolve merge conflicts.

Related to : #46265
See: adorsys#245 (comment)

closes #46274

@tdiesler
Copy link
Copy Markdown
Contributor

Could you name the test module(s) that this fixes. Perhaps also worth mentioning the conformance suite git rev that you are using.

@forkimenjeckayang
Copy link
Copy Markdown
Contributor Author

Could you name the test module(s) that this fixes. Perhaps also worth mentioning the conformance suite git rev that you are using.

This addresses oid4vci-1_0-issuer-happy-flow.

We validated against conformance-suite master after merge of MR : https://gitlab.com/openid/conformance-suite/-/merge_requests/1904

Observed suite build during validation: 5.1.41.

@tdiesler
Copy link
Copy Markdown
Contributor

tdiesler commented Apr 22, 2026

Yes, oid4vci-1_0-issuer-happy-flow passes in both variations

  • vci_credential_encryption=encrypted
  • vci_credential_encryption=plain

with keycloak/suite master (as of now)

image image

@forkimenjeckayang
Copy link
Copy Markdown
Contributor Author

Yes, oid4vci-1_0-issuer-happy-flow passes in both variations

  • vci_credential_encryption=encrypted
  • vci_credential_encryption=plain

with keycloak/suite master (as of now)

image image

Perfect, please also notice it solves this issue raised #46274.
Will need your feedback with respect to that and spec alignment too

@tdiesler
Copy link
Copy Markdown
Contributor

tdiesler commented Apr 22, 2026

Will need your feedback with respect to that and spec alignment too

sure, what do you need? It was probably fixed by this #47674
generally, everything I fixed is referenced from #47149

@forkimenjeckayang
Copy link
Copy Markdown
Contributor Author

Will need your feedback with respect to that and spec alignment too

sure, what do you need? It was probably fixed by this #47674

Probably but you see we have extra checks inlcuded which are spec aligned and should definitely handle and close this issue #46274

Copy link
Copy Markdown
Contributor

@mposolda mposolda left a comment

Choose a reason for hiding this comment

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

@forkimenjeckayang @tdiesler Thanks for the PR and review and additional comments.

Added few comments inline. Can you check them? Besides that, few other points:

  1. The admin console UI is unsynced after those changes. There is single attribute in the UI Require Encryption , which has tooltips mentioning request encryptions (which is not the case with your changes, as it is effectively changed to the "response encryption"). Is it possible to update UI to have Require Request Encryption and Require Response Encryption and update the tooltips accordingly? Also I hope that additional attribute for the "Signature" will not be needed (otherwise will be good to re-add that to the UI as well, but hopefully not...)

  2. Nitpick: Is it possible to rename method OID4VCIssuerWellKnownProvider.buildJwks maybe to something like buildJwksForEncryption ? So it is a bit more clear that it is intended for encryption

  3. It seems that when require request encryption is configured to true, it is not enforced at the credential-request that credential request is really encrypted? Per my understanding, if encryption is required for the request, we should reject credential request to the credential-endpoint in case that it is not encrypted. Is it correct? Feel free to do this point as a follow-up if you prefer (as I guess it may need some additional tests etc)

@forkimenjeckayang forkimenjeckayang requested a review from a team as a code owner April 23, 2026 11:52
Copy link
Copy Markdown

@keycloak-github-bot keycloak-github-bot Bot left a comment

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.authz.PolicyEvaluationTest#

Keycloak CI - Base IT (3)

org.opentest4j.AssertionFailedError: expected: <PERMIT> but was: <null>
	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.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
...
org.opentest4j.AssertionFailedError: expected: <PERMIT> but was: <null>
	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.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
...
org.opentest4j.AssertionFailedError: expected: <PERMIT> but was: <null>
	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.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
...

Report flaky test

@forkimenjeckayang
Copy link
Copy Markdown
Contributor Author

@forkimenjeckayang @tdiesler Thanks for the PR and review and additional comments.

Added few comments inline. Can you check them? Besides that, few other points:

  1. The admin console UI is unsynced after those changes. There is single attribute in the UI Require Encryption , which has tooltips mentioning request encryptions (which is not the case with your changes, as it is effectively changed to the "response encryption"). Is it possible to update UI to have Require Request Encryption and Require Response Encryption and update the tooltips accordingly? Also I hope that additional attribute for the "Signature" will not be needed (otherwise will be good to re-add that to the UI as well, but hopefully not...)
  2. Nitpick: Is it possible to rename method OID4VCIssuerWellKnownProvider.buildJwks maybe to something like buildJwksForEncryption ? So it is a bit more clear that it is intended for encryption
  3. It seems that when require request encryption is configured to true, it is not enforced at the credential-request that credential request is really encrypted? Per my understanding, if encryption is required for the request, we should reject credential request to the credential-endpoint in case that it is not encrypted. Is it correct? Feel free to do this point as a follow-up if you prefer (as I guess it may need some additional tests etc)

Thank you for taking out time to review @mposolda
All comments addressed. Please have another look when you are chanced

Copy link
Copy Markdown
Contributor

@mposolda mposolda left a comment

Choose a reason for hiding this comment

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

@forkimenjeckayang Thanks a lot for the updates!

I've added one small comment inline regarding attribute name.

Besides that: It can be good that there is built-in support for encrypted requests/responses in the OAuthClient/OID4VCClient framework, so that OID4VCIssuerEndpointEncryptionTest does not need to directly use Apache HTTP client. But that might be OK to do as a follow-up, so that this PR can be merged asap.

Signed-off-by: forkimenjeckayang <[email protected]>
@forkimenjeckayang
Copy link
Copy Markdown
Contributor Author

Besides that: It can be good that there is built-in support for encrypted requests/responses in the OAuthClient/OID4VCClient framework, so that OID4VCIssuerEndpointEncryptionTest does not need to directly use Apache HTTP client. But that might be OK to do as a follow-up, so that this PR can be merged asap.

Thank you @mposolda , I created a follow up PR #48462 from this branch. to address this.
Once this is merged will rebase . Please take a look when chanced.

Copy link
Copy Markdown
Contributor

@mposolda mposolda left a comment

Choose a reason for hiding this comment

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

@mposolda mposolda merged commit eb0c837 into keycloak:main Apr 24, 2026
85 checks passed
ahus1 pushed a commit to ahus1/keycloak that referenced this pull request Apr 24, 2026
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] Request and response encryptions

3 participants