OpenTDF and OpenID Connect (OIDC)
OpenTDF uses OpenID Connect (OIDC) as an external source of authentication and identity claims. It is not an identity provider (IdP).
In the current implementation, OpenTDF expects an external OIDC issuer to:
- authenticate users or clients
- issue signed access tokens
- publish discovery metadata at
/.well-known/openid-configuration - publish signing keys through the discovered
jwks_uri
OpenTDF then validates those tokens and uses selected claims as trusted input for endpoint authorization and policy decisions.
For concrete setup details, see Configuration, Running the Platform Locally, the Go SDK README, and otdfctl auth.
Deployment boundary
| Responsibility | External OIDC provider | OpenTDF |
|---|---|---|
| Authenticate end users or OAuth clients | Yes | No |
Host /.well-known/openid-configuration | Yes | No |
| Publish JWKS signing keys | Yes | No |
| Issue signed access tokens with claims | Yes | No |
| Validate access tokens on OpenTDF API requests | No | Yes |
| Use validated claims for authorization and policy evaluation | No | Yes |
Publish /.well-known/opentdf-configuration for OpenTDF clients | No | Yes |
In this repository's local quickstart, Keycloak fills the external IdP role. In other deployments, OpenTDF's OIDC authentication relies on the configured external issuer, expected audience, and that issuer's discovery/JWKS endpoints.
Two different well-known endpoints
OpenTDF deployments commonly involve two different discovery documents:
| Endpoint | Hosted by | Purpose |
|---|---|---|
<issuer>/.well-known/openid-configuration | external OIDC provider | OIDC discovery for issuer metadata such as issuer, token_endpoint, and jwks_uri |
<platform>/.well-known/opentdf-configuration | OpenTDF | OpenTDF-specific metadata, including the resolved issuer and selected discovered IdP metadata, that clients use to bootstrap authentication |
OpenTDF discovers the configured provider at startup and republishes selected metadata under idp, together with platform_issuer, in its own well-known configuration. OpenTDF Policy Enforcement Points (PEPs) should use the SDK to read this platform configuration and bootstrap IdP endpoint discovery from only the OpenTDF platform endpoint, rather than requiring separate IdP endpoint configuration. A PEP must still supply its client ID and any required credentials, and authentication still happens at the external IdP.
Relevant OIDC concepts in OpenTDF
-
Issuer
- Configured as
server.auth.issuer. - OpenTDF uses this URL to discover OIDC metadata at
/.well-known/openid-configuration. - OpenTDF expects the configured issuer and the discovery document's
issuervalue to agree; if they differ, the discovery document's issuer value is used for token validation.
- Configured as
-
Audience
- Configured as
server.auth.audience. - OpenTDF validates the incoming token's
audclaim against this expected audience value.
- Configured as
-
JWKS / signing keys
- OpenTDF reads
jwks_urifrom the discovery document. - It caches the remote key set and uses
server.auth.cache_refresh_intervalas the minimum refresh interval for that JWKS cache. - Incoming access-token signatures are validated against that cached JWKS.
- OpenTDF reads
-
Claims
- After token validation, OpenTDF uses configured claims from the access token to build request identity context.
- The current auth policy configuration supports:
server.auth.policy.username_claim(defaultpreferred_username)server.auth.policy.groups_claim(defaultrealm_access.roles)server.auth.policy.client_id_claim(defaultazp)
-
DPoP
- When enabled, OpenTDF also validates DPoP proof material associated with the access token.
- This is additional request binding on top of normal OIDC token validation, not a replacement for issuer/audience/signature checks.
End-to-end conceptual flow
- An end user or a machine-to-machine OAuth client authenticates with the external OIDC provider.
- The provider issues an access token for the audience OpenTDF expects.
- OpenTDF uses the configured issuer to discover OIDC metadata and load the provider's JWKS.
- The client calls an OpenTDF API with the access token (and optionally DPoP proof headers when that deployment uses DPoP).
- OpenTDF validates the token signature, issuer, audience, and time-based constraints before trusting its claims.
- OpenTDF extracts configured identity claims and uses them for endpoint authorization and downstream policy or decisioning context.
Where OpenTDF currently uses that identity context
Today, the implementation uses validated token context in a few distinct places:
- Request authentication middleware validates the incoming access token against the configured issuer, audience, and JWKS.
- Endpoint authorization builds subjects from configured claims and evaluates them through the configured authorization policy.
- Authorization service request context propagates the resolved client ID into downstream policy request context.
- Entity Resolution Service (ERS) can be configured separately:
keycloakmode integrates with Keycloak using ERS-specific service credentials.claimsmode resolves entity information from claims already present in JWT input.