-
Notifications
You must be signed in to change notification settings - Fork 303
ZTS Token Exchange: include SPIFFE ID claim in issued ID Token (JWT SVID support) #3233
Description
Description
Today, ZTS supports OAuth 2.0 Token Exchange for issuing an OIDC-style id_token. It would be very useful if the id_token returned by ZTS could include a SPIFFE ID (e.g., spiffe://...) so that the exchanged ID Token can be directly used as a JWT SVID credential by workloads.
I'm aware Athenz can already issue JWT SVIDs via the Copper/Argos procedure, but Token Exchange is increasingly the common integration point for external identity providers and workload identity flows, and having ZTS return a JWT SVID-compatible ID Token would reduce operational complexity (fewer moving parts, simpler client bootstrap, and a single standardized exchange endpoint).
Background / motivation
We have services that already perform OAuth Token Exchange to obtain an ID Token for downstream authn/authz. If ZTS includes the SPIFFE ID in that issued ID Token, those services can reuse the same token as a JWT SVID for SPIFFE-aware systems, improving interoperability while keeping the identity anchored to ZTS-issued policy decisions.
Request
- For Token Exchange requests that result in issued_token_type=urn:ietf:params:oauth:token-type:id_token, include a SPIFFE ID claim in the returned ID Token when it can be derived from the subject token (or otherwise reliably determined).
- Clarify the claim name/format in docs (e.g., spiffe claim with spiffe://... URI).
Acceptance criteria
- When exchanging into an ID Token, the response id_token contains a SPIFFE ID claim (when available).
- Unit/integration tests cover presence/absence cases and validate no behavior regression.
Proposed contribution
If this approach is acceptable, I can open a PR implementing the claim propagation + tests + documentation updates.