Skip to content

Idea: decouple required credentials from OAuth2 scope #4038

@reinkrul

Description

@reinkrul

In Nuts v5/spec v1, the OAuth2 scope is specified by the use case. The client requests whatever scope it wants, and the server honors it. It is then verified by EHR business logic (why, actually? and is this really the case?).

In Nuts v6/spec v2, the requested OAuth2 scope is mapped to a set of credentials that need to be presented. An access token is only issued when the client's presentation fulfills that requirement. During data exchange, the EHR business logic checks that the access token contains the expected scope.

However, this last approach (v6) causes multiple issues:

  • Only 1 scope is supported
  • Scopes must be static (imposible to SMART on FHIR-style scopes)

We could solve this by dropping the relation credential-OAuth2 scope in Nuts v6, by moving identity/claim verification (as specified by use case/policy) from access token-request-time to access-token-usage-time:

Access token request

  • we create 1 access policy (specifies which credentials to present/require for access token request)
    • It includes all defined credential types (e.g. X509Credential, HealthcareProviderRoleTypeCredential, DeziIDTokenCredential)
    • Could be extended by vendors if they use non-normative credentials/claims
  • Only organization credential is required, rest optional
    • The requester presents whatever identity claims it has, as credentials;
      • care provider (org)
      • care provider (org) role type
      • care giver (person); if applicable (provided by EHR)
      • inschrijftoken/mandaattoken etc; if applicable (might be provided by EHR?)
    • The holder verifies whatever was presented, requiring at least care provider identity, then issues access token

Access token usage/data exchange

  • The holder evaluates all supported authZ policies (eOverdracht, HA-inzage, ANW, BgZ, MO);
    • If any policy gives access, the request is allowed. If none do, the request is denied.
    • Policies only give access if the required identities/claims are present in the access token (introspection response)

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