-
Notifications
You must be signed in to change notification settings - Fork 23
Description
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:
- DCQL approach — initial investigation
- Inject selector into PD matcher — architecture decision
- Drop match_policy — simplification
- PRD changelog (2025-03-25) — pivot to named parameters after user feedback