Skip to content

[OID4VP] Delegate trust material to an external trust IdP by alias - #51673

Merged
rmartinc merged 1 commit into
keycloak:mainfrom
dominikschlosser:vp-trust-material-idp
Aug 25, 2026
Merged

rmartinc merged 1 commit into
keycloak:mainfrom
dominikschlosser:vp-trust-material-idp

Conversation

@dominikschlosser

Copy link
Copy Markdown
Contributor

Closes #50664

@rmartinc @vaceksimon @mabartos This is required work for supporting the ETSI trust list integration thats needed for the EUDI ecosystem

@mposolda This does some refactoring for the TrustMaterialIdentityProvider and Cert chain validation / EKU requirements. So please review as well.

Trust delegation

  • Added trustMaterialIdps to the OID4VP idp config: comma-separated aliases of trust material identity providers (e.g. default-trust) supplying the trusted issuer keys and X.509 trust anchors. Takes precedence over the inline trustedIssuerJwks; config validation requires one of the two.
  • TrustMaterialSdJwtIssuerResolver mandates chain validation whenever the resolved trust material exposes X.509 anchors (HAIP 6.1.1): the credential's x5c must validate against the anchors and the chain leaf key verifies the signature; a credential without an x5c is rejected instead of silently falling back to key lookup. Only anchor-free configurations resolve trusted keys by kid/alg/iss hints.

Certificate chain validation moved out of the attestation code

  • Moved the generic PKIX chain validation from the package-private AttestationX509CertificateValidator to org.keycloak.crypto.X509CertificateChainValidator in core, so both OID4VCI attestation and OID4VP presentation verification share one implementation.
  • TrustMaterialIdentityProvider gained a default method validateX509Chain that validates the presented certificate chain against the provider's X.509 trust material. TrustMaterialResolver applies the same logic across several providers referenced by alias, replacing the removed AttestationX509CertificateValidator.

Required EKUs are configuration instead of being hardcoded

  • Renamed attestationExtendedKeyUsages to requiredExtendedKeyUsages (X509TrustMaterial.requiredExtendedKeyUsages accordingly): the leaf certificate must contain at least one of the configured OIDs, additional EKUs are fine, an empty list imposes no restriction.
  • Previously an EKU policy was mandatory for any X.509 trust material, which is an attestation-specific assumption. Issuer signing certificates in OID4VP are not bound to an attestation purpose though, so this had to be made more generic.

@dominikschlosser
dominikschlosser requested a review from a team as a code owner August 12, 2026 10:49
Copilot AI balanced review requested due to automatic review settings August 12, 2026 10:49
@dominikschlosser
dominikschlosser requested a review from a team as a code owner August 12, 2026 10:49

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mposolda

Copy link
Copy Markdown
Contributor

@forkimenjeckayang @Awambeng @IngridPuppet Just pinging you for the review (I am not able to add you directly as reviewers).

@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.webauthn.passwordless.WebAuthnPwdLessPropertyTest#timeout

Keycloak CI - WebAuthn IT

org.openqa.selenium.WebDriverException: 
unknown error: unhandled inspector error: {"code":-32000,"message":"Node with given id does not belong to the document"}
  (Session info: chrome=150.0.7871.128)
Build info: version: '4.28.1', revision: '73f5ad48a2'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.17.0-1020-azure', java.version: '25.0.3'
...

Report flaky test

Copilot AI review requested due to automatic review settings August 12, 2026 17: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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 14, 2026 20:07

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 14, 2026 21: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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 18, 2026 15:06

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 25, 2026 07:27

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Signed-off-by: Dominik Schlosser <dominik.schlosser@gmail.com>
@rmartinc
rmartinc force-pushed the vp-trust-material-idp branch from d314ce1 to 8cfad07 Compare August 25, 2026 08:46
Copilot AI review requested due to automatic review settings August 25, 2026 08:46

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 24 out of 24 changed files in this pull request and generated 4 comments.

Comment on lines +60 to +62
name="config.requiredExtendedKeyUsages"
label={t("requiredExtendedKeyUsages")}
labelIcon={t("requiredExtendedKeyUsagesHelp")}

@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.

The updates in this PR looks good to me, but I did not verify the pieces related to VP.

Leaving to the @rmartinc , @mabartos , @vaceksimon .

@forkimenjeckayang @Awambeng @Ogenbertrand @IngridPuppet Anyone from your team available to review?

@rmartinc rmartinc 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.

I tested this yesterday and it was working OK for the PID combined (configuring the trust using jwks and certificate). So I think it is OK. I'm approving and merging it.

@forkimenjeckayang @Awambeng @Ogenbertrand @IngridPuppet If anyone finds some issue, please fill a follow-up issue for the findings.

Thanks @dominikschlosser and all people involved here!

@rmartinc
rmartinc merged commit 0c54fe8 into keycloak:main Aug 25, 2026
151 of 153 checks passed
@mabartos

Copy link
Copy Markdown
Member

@dominikschlosser

Copy link
Copy Markdown
Contributor Author

@mabartos I commented on the linked report, it is a false positive.

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.

[OID4VP] Delegate trust material to an external trust IdP by alias

6 participants