Repository navigation
Description
Why?
Nice-to-have integration with ELIXIR Compute WP2 (AAI), tracked in elixir-cloud-aai/generic-issues#58 (D4.1). LS Login supports OAuth 2.0 token exchange (RFC 8693); the LS AAI operations minutes of 10 December 2025 record "OIDC Token exchange fixed according to specification".
Since #488 (closing #397), proTES can request a client-credentials token per TES backend, so backends can't replay their tokens at each other. Those tokens still name proTES, not the user: backends can't apply their own per-user policy, and #254 lists token exchange as the long-term way to pass the user on. With token exchange, proTES swaps the caller's token for a token whose audience is the backend it calls, so each hop gets a token for itself only, and the user stays the subject.
How?
Opt-in, off by default; nothing changes without the setting.
- Config: per identity provider, enable token exchange and choose
resource(RFC 8707) oraudience, reusingaudience_parameterand the per-backendaudienceof feat: request access tokens per TES backend #488. - On requests made on behalf of a user (create, get, list, cancel relayed to a backend), proTES sends a token exchange request (
grant_type=urn:ietf:params:oauth:grant-type:token-exchange,subject_token= the caller's access token, plus the backend's audience) and calls the backend with the result. - Calls without a user request behind them (background polling) keep proTES's own per-backend client-credentials token. Document the difference.
- Cache exchanged tokens per subject token and audience, no longer than either token lives; never log or store them.
- Errors: a refused exchange fails the request with a clear message that names the audience, not the token.
- Docs:
docs/access-control.md(what the identity provider must allow per client, e.g. that the caller's token must name proTES inaud, and which targets proTES may exchange for),docs/configuration.md,docs/upgrading.md. - Tests against a mock identity provider; the live check is done in the token exchange testbed.
Fit the design to either outcome of #391 (thin gateway proposal), which makes token exchange a core gateway feature. If proWES needs the same, move the exchange client into FOCA.
Acceptance criteria
- With the setting on, a backend receives a token whose audience is that backend and whose subject is the user.
- With the setting off, behaviour is unchanged.
- Documented, including identity provider requirements.
Blocked by the testbed's live checks against LS Login: client registration (elixir-cloud-aai/token-exchange-flow-testbed#8) and the delegated call chain (elixir-cloud-aai/token-exchange-flow-testbed#10).
Part of the ELIXIR Compute Platform WP4 sprint (M&Ds due end of December 2026); nice to have.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNice to have
Activity
uniqueg commentedon Nov 21, 2026
One more requirement for this feature (decided on 2026-11-21, from LS Login's answers recorded in elixir-cloud-aai/token-exchange-flow-testbed#36): after an exchange, LS Login puts the exchanging client into
audas well, next to the target. So a token proTES obtained for a TES backend would also be accepted by proTES itself.client_id(orazp) is proTES's own client, i.e. tokens it obtained itself by exchange. Confirm first in the token exchange testbed (T1) thatclient_idstays the exchanging client after an exchange; if it doesn't, use the claim T1 shows instead.In parallel, LS Login is asked to put only the target into
aud.uniqueg commentedon Nov 25, 2026
Update from LS Login (Jan Pavlíček, 24 Nov 2026): in the new LS Login proxy, the calling client's
client_idwill no longer be added implicitly toaudafter a token exchange. The current proxy still adds it, and that can't be switched off.Consequence for this issue: the self-refusal check above stays (it covers the current proxy and costs little as defence in depth), but it is no longer the long-term fix. Once the new proxy is live, an exchanged token names only the target in
aud.