Skip to content

Credential selection when multiple credential from wallet match #4067

@reinkrul

Description

@reinkrul

Problem

When a wallet contains multiple credentials of the same type, the Nuts node needs a way for the EHR to specify which one to select:

  • PatientEnrollmentCredential: one per patient in the wallet
  • HealthcareProviderTypeCredential: one per organization type (e.g. pharmacy and hospital)

The current PD matcher picks the first match, which is non-deterministic.

Related: #3993

Solution: credential_selection (named parameters)

A new optional credential_selection parameter on the request-service-access-token endpoint. The EHR provides simple key-value pairs mapping PD field IDs to expected values:

{
  "scope": "medicatieoverdracht-gf",
  "authorization_server": "https://verifier.example.com",
  "credential_selection": {
    "patient_id": "123456789"
  }
}

The PD author controls what is selectable by assigning id values to constraint fields (already done for introspection claims). The EHR only needs to know the field name and value — no JSON paths, no query language.

See the full PRD for design details, trade-offs, and architecture.

Status

Sub-issue Description PR Status
#4088 CredentialSelector extension point in PD matcher #4098 Open
#4120 Selection CredentialSelector (filter by field ID values) #4121 Open
#4090 Wire credential_selection through API to presenter #4122 Open

Dependency graph

#4088 → #4120 → #4090

Closed / superseded

Issue Reason
#4089 DCQL selector — superseded by #4120 (named params approach)
#4087 DCQL parser — kept open for potential future use, not needed for current approach

Decision trail

The comments below document the evolution from DCQL-based credential queries to the simpler named-parameter approach. Key decisions:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions