Skip to content

OpenDI4VCI: Hoist credential_configuration_id to request-credential API root #4248

@reinkrul

Description

@reinkrul

Problem

POST /internal/auth/v2/{subjectID}/request-credential today requires the EHR to construct an authorization_details array with OpenID4VCI internals (type: \"openid_credential\", credential_configuration_id, optional format). The EHR shouldn't need OpenID4VCI/RFC 9396 knowledge to ask for a credential, and the issuer's preferred wire form (scope vs authorization_details) is something the node can negotiate from AS metadata.

Proposal

  • Hoist credential_configuration_id (and optionally format) to the root of the request body.
  • authorization_details becomes optional — kept only as an escape hatch for advanced cases (full RFC 9396 control). Default flow uses the hoisted field.
  • Node-side dispatch on the Authorization Request, driven strictly by metadata (no probing/retry):
    1. AS metadata authorization_details_types_supported contains openid_credential → put authorization_details with credential_configuration_id in the Authorization Request. Credential Request later uses credential_identifier (details-flow, per §8.2 + Token Response credential_identifiers).
    2. Else if issuer credential metadata's credential_configurations_supported[<id>].scope is in AS scopes_supported → put that scope in the Authorization Request. Credential Request uses credential_configuration_id (§8.2 scope-flow branch).
    3. Else → omit credential identification from the Authorization Request entirely. Put credential_configuration_id in the Credential Request body (§8.2 allows this independently of how authorization was scoped).

Branch 3 is spec-fuzzy at the AS side — §3.4 says the Authorization Request "MUST include scope or authorization_details" — so the issuer has to authorize credential issuance via some other context (pre-arranged client privileges, user identity, etc.). We expose it as a best-effort fallback and let the issuer reject if it really won't work.

Out of scope

  • No changes to the OpenID4VCI wire protocol with issuers — only the internal EHR ↔ Nuts API.

Pros

  • Caller surface stops leaking OpenID4VCI/RFC 9396 internals.
  • Issuer-flow negotiation lives in the node, where AS metadata is fetched anyway.
  • API stays stable across issuer spec drift (scope-flow ↔ details-flow ↔ credential-request-only).

Cons / open questions

  • authorization_details carries more than just credential_configuration_id (format, claims, locations, …). Keeping it as an escape hatch handles advanced cases; decide whether format deserves promotion to a root field.
  • Breaking change on an experimental API.
  • Implementation cost: metadata dispatch + scope-flow path + branch-3 fallback + tests for each branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions