Skip to content

[OID4VCI] Some error events not reported #51692

Description

@mposolda

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

oid4vc

Describe the bug

In case of some error scenarios in the OID4VCI credential request, the error event is not reported.

  1. In case that OID4VCI client scope is configured without any mappers, there is this exception in the credential request (which is however not reported anywhere):
java.lang.NullPointerException: Cannot invoke "org.keycloak.protocol.oid4vc.model.Claims.stream()" because the return value of "org.keycloak.protocol.oid4vc.model.CredentialMetadata.getClaims()" is null
	at org.keycloak.protocol.oid4vc.issuance.OID4VCIssuerEndpoint.validateRequestedClaimsArePresent(OID4VCIssuerEndpoint.java:1961)
	at org.keycloak.protocol.oid4vc.issuance.OID4VCIssuerEndpoint.getVCToSign(OID4VCIssuerEndpoint.java:1873)
	at org.keycloak.protocol.oid4vc.issuance.OID4VCIssuerEndpoint.prepareCredential(OID4VCIssuerEndpoint.java:1769)
	at org.keycloak.protocol.oid4vc.issuance.OID4VCIssuerEndpoint.requestCredential(OID4VCIssuerEndpoint.java:1093)

Would be probably good to handle NullPointerException and also make sure that error event is created and reported and we have automated test to check that event was reported

  1. In case that there is some issue in validation of OID4VCI proof in the credential request (For example "proof is too old", which happened to me during debugging), there is also not error event reported. We probably already have some tests for proof errors, so maybe it is just a matter of making sure that we also test that error event is thrown for this case?

Version

nightly (from 2026-08-12)

Regression

  • The issue is a regression

Expected behavior

Error events reported

Actual behavior

Error events are not reported for some error scenarios in OID4VCI credential request

How to Reproduce?

See the description

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions