This repository contains GitHub-renderable architecture notes for discussing security, IAM, and token-handling options.
Each proposal lives in its own folder and uses Mermaid top-down flow diagrams inside README.md files so the content renders directly in GitHub.
The diagrams distinguish three zones where relevant:
Security Frontend: WAF and API gateway as separate entry paths in front of the online cluster.Online Cluster: browser-facing IAM and backend workloads.Intranet Cluster: internal services and their own OIDC-compliant IAM.
How to read the diagrams:
- The numbered arrows are the main request path.
Cluster ingressonly routes traffic into the cluster. Validation happens inoauth2-proxy, the API gateway, the service, or mesh policy depending on the proposal.- When a service calls
Online Keycloak, that is the point where cluster identity can be used for workload identity. In the Keycloak 26.6.0-compatible variants, that means client authentication on the token request, not validation at ingress. - The examples are illustrative protocol shapes, not full product configuration.
- The concrete example flow uses four business participants:
Browser UI,UI Service,Online Service, andIntranet Service.
- oauth2-proxy-no-client-token:
oauth2-proxyintegrated at cluster ingress, opaque browser session only, Keycloak token exchange for online APIs, and JWT bearer grant at the intranet IAM. - dpop-token-exchange: Same basic shape as today, but the edge uses DPoP, online hops use Keycloak token exchange, and the intranet IAM exchanges trusted online tokens directly.
- dpop-workload-identity: Clear split between user identity and workload identity using DPoP at the edge, cluster identity for service-to-Keycloak authentication, Keycloak exchange for online hops, and JWT bearer grant plus optional workload auth at the intranet IAM.
| Proposal | Token in browser | User vs workload identity | Service-to-service model | Online IAM to intranet IAM trust |
|---|---|---|---|---|
| Current state | Yes | Mostly coupled | Same user token is propagated | Implicit and provider-specific |
oauth2-proxy edge session |
No | Better separation at the edge | Internal APIs use exchanged tokens | Intranet IAM exchanges trusted online tokens directly |
| DPoP + token exchange | Yes, but sender-constrained on the edge | Separated on the online hops by exchanged tokens | No raw token chaining, each hop gets a new audience token | Intranet IAM exchanges trusted online tokens directly |
| Edge DPoP + workload identity | Edge token only | Strong separation | Workload identity authenticates the caller to Keycloak, exchanged tokens carry authorization context | Intranet IAM exchanges trusted online tokens directly |
The Current state row stays here only as a comparison baseline. It no longer has its own folder.
- Whether the browser should ever hold an OAuth token at all.
- Whether DPoP is worth using inside the cluster or should stay an edge concern.
- How much authorization context should travel in exchanged access tokens versus workload identity.
- How explicit the online-token to intranet-IAM trust contract should be.
OIDC: an identity layer on top of OAuth 2.0. In these proposals it is used for user authentication at the online IAM. The important outputs are the authenticated user session and the tokens issued after login.DPoP: a sender-constraining mechanism for OAuth tokens. The client sends a signed DPoP proof with the HTTP request, and the token can carry confirmation data that binds it to the proof key. In these proposals, DPoP protects tokens that would otherwise be replayable bearer tokens.SPIFFE: a standard identity format for workloads. A SPIFFE ID is a URI such asspiffe://online.example/ns/apps/sa/ui-service. In these proposals, SPIFFE is relevant only as a way to name the calling online workload.WIMSE: current IETF work on workload identity in multi-system environments. In these proposals, WIMSE is relevant as a direction for how workload identity and related security context can be conveyed to an IAM. It is not treated here as a finished wire protocol or a mandatory dependency.
Cluster ingressroutes traffic into the online cluster.API Gatewaymay validate edge tokens or DPoP proofs if that is part of the proposal.oauth2-proxymay validate browser sessions where that is part of the proposal.ServiceorIstio sidecarmay validate tokens inside the cluster where that is part of the proposal.Istio sidecarmay also be the place where workload identity is sourced for a laterService -> Online Keycloaktoken request.Online Keycloakis used for online login and online token exchange.- In the proposal variants, the intranet IAM is the exchange point for intranet tokens.
- The online service presents an online token to the intranet IAM, typically with JWT bearer authorization grant semantics and optionally with workload-based client authentication.
- For Keycloak-compatible workload identity, the
Service -> Online Keycloaktoken request uses client authentication. In Keycloak 26.6.0 this can be a registered client secret, signed JWT, or federated client authentication backed by Kubernetes service account or another trusted issuer.
OIDC: supported by current Keycloak.DPoP: supported in Keycloak 26.6.0.JWT Authorization Grant: supported in Keycloak 26.6.0 for external-to-internal token exchange using signed JWT assertions.Standard token exchange (V2): supported in Keycloak 26.6.0, but only for internal-token to internal-token exchange in the same realm.Federated client authentication: supported in Keycloak 26.6.0 for OpenID Connect and Kubernetes service account assertions. SPIFFE support exists, but remains preview.Delegation semantics: current Keycloak does not document out-of-the-box support for RFC 8693 delegation features such asactor_tokentoactclaim mapping.DPoP subject tokens: Keycloak standard token exchange rejects sender-constrainedsubject_tokenvalues, including DPoP-bound access tokens.Workload identity at Keycloak: for the online in-cluster hops in these proposals, workload identity is modeled as client authentication on theService -> Online Keycloaktoken request.JWT Authorization Grantis a different mechanism and is only relevant when the external assertion itself is the authorization grant.Intranet token exchange: outside Keycloak standard token exchange V2. These proposals assume the intranet IAM accepts trusted online tokens using JWT bearer authorization grant semantics and optionally SPIFFE-based or JWT-assertion-based workload authentication.