-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Problem description
CAMARA is evolving towards richer authorization models through the use of Rich Authorization Requests RAR and persistent consent handling via the Consent API. These mechanisms enable fine-grained expression and storage of scope and purpose combinations agreed by the end user.
However, once consent has been obtained and an access token is issued via existing 3-legged flows (e.g. OIDC Authorization Code or CIBA), the resulting access token often needs to carry a broader set of scopes, purposes, and audiences in order to support multiple CAMARA APIs (For eg. a use case where the purpose is dpv:FraudIdentificationAndDetection and the required scopes are: location-verification:verify sim-swap:check number-verification:verify device-roaming-status:roaming that requires multiple API access). This increases the attack surface area of the token and limits the ability to enforce least-privilege access at runtime.
Obtaining narrowly scoped and audience-restricted access tokens for individual CAMARA APIs typically requires re-running authorization flows or relying on broad tokens, even when valid consent already exists. This creates unnecessary coupling between user interaction and backend resource access resulting in bad end user experience.
Possible evolution
OAuth 2.0 Token Exchange (RFC 8693) could be introduced as an optional capability within CAMARA to complement RAR and consent-based authorization flows. With this model:
- An initial access token is obtained after end-user authentication using existing CAMARA-aligned flows (OIDC Authorization Code or CIBA).
- This access token is subsequently used as a
subject_tokenin a token exchange request. - Backend services can exchange the subject token for access tokens that are:
- Audience-restricted to a specific CAMARA API
- Narrowly scoped to the minimum required scopes and purposes
- Additional CAMARA APIs can be accessed by performing further backend-only token exchanges, without additional end-user interaction.
This enables runtime enforcement of least-privilege access while preserving a seamless end-user experience. CAMARA already supports JWT bearer client assertions, which align naturally with Token Exchange.
It also supports enhanced auditability through the optional use of actor_token and the resulting act claim, allowing identification of the acting component within an API consumer, in addition to the client_id and sub claims. Note: actor_token not fully supported in Keycloak as of today I think.
Token Exchange would be additive and optional, not a replacement for existing CAMARA authorization flows. It can greatly improve end user experience and has greater scope for finer-grained runtime access control and auditability.
Alternative solution
N/A
Additional context
https://www.rfc-editor.org/rfc/rfc8693