Skip to content

feat(openid4vci): client compliance (issue #3152)#4058

Draft
JorisHeadease wants to merge 5 commits intofeature/openid4vci-v1from
feature/openid4vci-client-compliance
Draft

feat(openid4vci): client compliance (issue #3152)#4058
JorisHeadease wants to merge 5 commits intofeature/openid4vci-v1from
feature/openid4vci-client-compliance

Conversation

@JorisHeadease
Copy link
Contributor

@JorisHeadease JorisHeadease commented Mar 11, 2026

Summary

Client-side OpenID4VCI v1.0 compliance improvements per issue #3152, building on the wire format migration in #4057.

Planned commits

  • Validate authorization_details against issuer metadata (Section 5.1.1)~~
  • Validate proof_signing_alg_values_supported (Appendix F.1)
  • Detect deferred credential issuance (Section 7.3)
  • Enable DPoP for VCI flows (RFC 9449 + Section 5.1.3)
  • PAR support (Section 5.1.4)
  • credential_identifiers in token response (Section 6.2)
  • Scope-based credential requests (Section 5.1.2)
  • credential_identifiers_supported and signed_metadata (Section 11.2)

Notification endpoint (Section 10) is deferred — depends on credential lifecycle management.

Closes #3152

Validate authorization_details entries per v1.0 Section 5.1.1:
- type must be "openid_credential"
- credential_configuration_id is required and must exist in issuer
  credential_configurations_supported
- Inject locations field when authorization_servers is present
- Sanitize entries to only known keys to prevent arbitrary JSON
  passthrough
- Reject multiple entries (single credential issuance only)

Add CredentialConfigurationsSupported to OpenIDCredentialIssuerMetadata.

Also fix nil context usage throughout openid4vci_test.go: use
context.Background() for method calls and gomock.Any() for mock
expectations.
Check holder's signing algorithm against the issuer's advertised
proof_signing_alg_values_supported (v1.0 Appendix F.1) in both the
authorization code flow and pre-authorized code flow. Shared
validation logic extracted to openid4vci.ValidateProofSigningAlg.
@JorisHeadease JorisHeadease linked an issue Mar 11, 2026 that may be closed by this pull request
@qltysh
Copy link

qltysh bot commented Mar 11, 2026

Qlty

Coverage Impact

⬆️ Merging this pull request will increase total coverage on feature/openid4vci-v1 by 0.02%.

Modified Files with Diff Coverage (7)

RatingFile% DiffUncovered Line #s
Coverage rating: B Coverage rating: B
auth/oauth/types.go100.0%
Coverage rating: B Coverage rating: B
vcr/holder/openid.go73.3%261-262, 266-267
Coverage rating: B Coverage rating: B
auth/client/iam/openid4vp.go75.0%366-367
Coverage rating: C Coverage rating: C
vcr/openid4vci/issuer_client.go100.0%
Coverage rating: A Coverage rating: A
auth/api/iam/openid4vci.go92.7%90, 105-106, 252-253...
Coverage rating: C Coverage rating: C
auth/client/iam/client.go67.7%344-345, 349-350...
New file Coverage rating: A
vcr/openid4vci/types.go100.0%
Total88.3%
🤖 Increase coverage with AI coding...

In the `feature/openid4vci-client-compliance` branch, add test coverage for this new code:

- `auth/api/iam/openid4vci.go` -- Lines 90, 105-106, 252-253, 262-263, and 324-325
- `auth/client/iam/client.go` -- Lines 344-345, 349-350, 354-355, 359-360, and 365-366
- `auth/client/iam/openid4vp.go` -- Line 366-367
- `vcr/holder/openid.go` -- Lines 261-262 and 266-267

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Detect transaction_id in credential responses (v1.0 Section 8.3) and
return a clear error instead of a generic "no credentials" message.
The transaction_id value is logged at warn level but excluded from
error messages to prevent leaking issuer-internal state.
Use Pushed Authorization Requests when the AS metadata advertises a
pushed_authorization_request_endpoint. All authorization parameters are
POSTed server-to-server; the browser redirect carries only client_id
and the returned request_uri. Falls back to query parameters when PAR
is not advertised.
When the token response includes authorization_details with
credential_identifiers (v1.0 Section 6.2), use credential_identifier
instead of credential_configuration_id in the credential request
(Section 8.2). Adds GetRaw to TokenResponse for accessing non-string
additional parameters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align OpenID4VCI client with implementers draft

1 participant