Repository navigation
Auth flow
This document covers the following two chains:
- TES: User → Krini → LS Login → TES component → proTES → TES (TESK, Funnel or Poiesis at a node)
- WES: User → Krini → LS Login → WES component → Conquest → proTES → TES
It names one target (industry best practice) and one MVP that we can deliver for M4.4. The M4.4 minimum is "basic OAuth2-based access control from client at least to the gateway". The MVP goes a little further, so that the TES backends aren't open either.
Out of scope: the shared S3 credentials of the TES instances. This is a known, accepted risk until after delivery.
From https://login.aai.lifescience-ri.eu/oidc/.well-known/openid-configuration, read 2026-10-21:
-
Issuer:
https://login.aai.lifescience-ri.eu/oidc/. -
Grants:
authorization_code(PKCES256),refresh_token,client_credentials,urn:ietf:params:oauth:grant-type:token-exchange,device_code, andimplicit, which we don't use. -
Scopes:
offline_accessandeduperson_entitlement. The latter is where group memberships such asECP_CLNcome from, delivered through userinfo. - Endpoints: introspection, revocation, userinfo, and JWKS (for JWT signatures).
The access token Krini receives (sample from 2026-10-20) is a JWT access token as defined in RFC 9068:
- Header:
typ: at+jwt,alg: RS256,kid: rsa1. -
issis LS Login's issuer. -
audandclient_idare both Krini's client ID. There's noazpclaim and no other audience. -
scope:openid profile email eduperson_entitlement ga4gh_passport_v1. There's nooffline_access, so Krini most likely gets no refresh token. -
Lifetime 4 h (
exp - iat= 14,400 s). -
acrishttps://refeds.org/profile/sfa, i.e. single-factor login. -
subis the user's LS ID (…@lifescience-ri.eu). -
No group claims in the token:
ECP_CLNhas to come from userinfo (or from the passport visas), called with this token.
Still to be checked with the LS Login team (§8):
- whether public clients can get refresh tokens (
offline_access); - whether token exchange accepts
audience/resourceparameters, and which audience the issued tokens get; - how service (
client_credentials) tokens look: theirclient_id,audand lifetime.
- Only trusted issuers. Each service has an exact-match allowlist of issuers, today only LS Login. Tokens from any other issuer are rejected before anything else happens. The issuer's keys come only from configuration, never from the token. That was the old cloud-registry hole.
- Access tokens go to APIs; ID tokens never do. The ID token is only for Krini's own login session.
- Every service validates every request. No service relies on "the caller already checked". How strict the check is depends on the hop (§6).
-
Validate users at the edge, use service identities inside (MVP). Conquest and proTES call the next service with their own token (
client_credentials), not with the user's token. That avoids expired user tokens in long runs and the question of whichauda TES backend should expect. The user's identity travels as data: thesubgoes into TES tasktagsfor accounting and audit. -
Group-based authorization. Users need the
ECP_CLNentitlement to run compute, andECP_CLN:ADMINfor admin actions. Entitlements are read from userinfo and cached for at most 5 minutes, as cloud-registry does with FOCA 0.15. - Short-lived tokens, refreshed by the party that holds them. No service stores a user's refresh token in the MVP.
| Hop | Credential sent | Checked by the receiver |
|---|---|---|
| Krini → LS Login | Authorization Code + PKCE (S256), public client; scopes openid profile email eduperson_entitlement
|
— |
| Krini → proTES (TES component) | user's access token, Authorization: Bearer
|
issuer, signature, exp/nbf (≤60 s leeway), client (aud or azp) ∈ {Krini, dashboard, CLI client IDs}, ECP_CLN
|
| Krini → Conquest (WES component) | user's access token | same as proTES |
| Conquest → proTES | Conquest's own token (client_credentials, fetched again when it expires) |
issuer, signature, expiry, azp ∈ {Conquest}; no group check (a service, not a user) |
| proTES → TES backend | proTES's own token (client_credentials) |
issuer, signature, expiry, client_id ∈ {proTES}; no aud check
|
| Krini/Components/CLI → TES backend (direct, bypassing proTES) | user's access token | issuer, signature, expiry, client_id ∈ {Krini, dashboard, CLI client IDs}, ECP_CLN; no aud check
|
Notes:
-
Which claims to check: LS Login puts the client into
client_id(RFC 9068), notazp. In the table, "azp" means theclient_idclaim. At the edges,aud= the frontend's client ID, which is what LS Login issues today. -
The
audproblem at TES: TES backends check the client that obtained the token (client_id), not its audience. That client ID is predictable (proTES), while the audience would have to be known when the token is issued. -
Token type: validators also require the header
typ: at+jwt, so that an ID token sent by mistake is rejected (RFC 9068 §4). -
Personal data: the
subin task tags is a personal identifier. Nodes must only use it for accounting and audit, and the privacy notices must say so. -
Expiry:
- Requests from Krini are short; Krini refreshes before expiry (§5.3).
- Background calls (Conquest submitting tasks hours later, proTES polling task status) use the service's own tokens, which never go stale.
-
User identity downstream: proTES and Conquest set TES
tagswith the user'ssub(and the original client). Backends treat these as information for accounting, not as authorization. -
Accepted MVP risks:
- A stolen proTES token gives access to all TES backends until it expires; keep its lifetime short and its secret in a Kubernetes Secret.
- For tasks that come through proTES, TES backends can't apply their own per-user policy (e.g. a node admitting only its own users, or per-user quotas), because they only see proTES. For direct submissions they see the user and can. This affects only services behind a gateway. Services that receive user tokens directly keep full per-user access control: the Cloud Registry (owners, maintainers), proTES for tasks submitted from Krini or the dashboard, and Conquest for workflows.
- Krini, as a single-page app, keeps tokens in the browser.
Krini, the TES and WES Cloud Components and proTES (and later Conquest) may call the Cloud Registry to find the available TES and WES instances.
-
Reads need no token.
GET /services,GET /services/{id}andGET /services/typesare public, so clients call them without a bearer token. Sending a user's token where none is needed only exposes it. Writes (registering, editing, verifying services, managing roles) need a user token. The registry'saudiencemust then list the client ID of the frontend used, e.g. Krini's or the registry UI's. -
Registry entries aren't trusted by default. Any LS Login user can register a service and becomes its owner. An entry pointing at a malicious endpoint would receive tasks, input locations, and the token sent along: in the MVP that is proTES's service token, which every TES accepts (§4). So:
- Consumers use only entries that an admin has marked as
verified, filtered by type (org.ga4ghtes/wes, with the version) andenvironment(e.g.prod). Filtering happens on the client, since the registry API has no query filters (yet). - The registry's own URL is configured in each consumer and called over HTTPS only. It is the trust anchor; discovery never comes from user input.
- Only HTTPS endpoint URLs are used, as the registry already enforces for new entries.
- Consumers use only entries that an admin has marked as
-
Discovery in practice:
- proTES caches the list (refreshing e.g. every few minutes) and keeps the last good list if the registry is unreachable.
- Krini and the Components use the list to show and choose services. They may send tasks to proTES or directly to a TES backend (§4, last row), but only to verified entries. A direct request carries the user's token, which every edge service accepts, since they all accept tokens issued to Krini. So a rogue backend could replay it elsewhere until it expires (up to 4 h).
- Target: per-backend audiences via token exchange (§5.2) limit the damage of a rogue entry to that entry. Signed service-info or node attestation could come later.
-
MVP and target: an exact-match allowlist containing only
https://login.aai.lifescience-ri.eu/oidc/, in every service's configuration (FOCA:security.auth). - Other issuers are rejected with 401.
- Keys come from the configured issuer's JWKS, cached and refreshed when a key ID is unknown.
-
MVP:
- The edges (proTES, Conquest) require
aud(orazp, depending on what LS Login puts in its tokens) to contain the registered client IDs of our frontends: Krini, the dashboard and the CLI. Every new frontend has to be added there, which is the same rule cloud-registry has. - TES backends don't check
aud; they checkazp∈ {proTES} (§4).
- The edges (proTES, Conquest) require
-
Target:
- Each hop gets a token made for the next service, through token exchange (RFC 8693, supported by LS Login).
- proTES exchanges its incoming token for one with
aud= the chosen TES backend, carrying anactclaim (the "actor", proTES). - Every service checks that
audis itself, and a token stolen at one service can't be used at another.
- Lifetime: access tokens live 4 h. That is enough for interactive use in Krini, but not for workflows that run longer, which is one more reason for service tokens behind the edge.
-
Krini (MVP):
- Krini gets no refresh token today (no
offline_access). Shortly before the token expires, it signs in again silently (prompt=none, works while the LS Login session lasts). If LS Login allows public clients to have refresh tokens, it uses those instead, with rotation. - On a 401 from an API, it refreshes once and retries the request once, then asks the user to log in again.
- The Cloud Components get the token from a callback for each request, not once at setup (cloud-components#442).
- Krini gets no refresh token today (no
- Services: no user tokens are stored. Long-running work uses service tokens (§4).
-
Target:
- Conquest exchanges the user's token for an
offline_accessrefresh token scoped to proTES. It keeps that token encrypted for the duration of the run and revokes it when the run ends. - That way, actions inside the run are still on the user's behalf, and revoking the user's access stops them.
- Conquest exchanges the user's token for an
-
Krini and the dashboard: Authorization Code with PKCE (S256).
- No implicit or hybrid flows: the OAuth 2.0 Security Best Current Practice (RFC 9700) deprecates them.
-
Target: a backend-for-frontend. Krini gets a small backend as a confidential client, so tokens stay on the server and the browser only gets an
HttpOnlysession cookie.
- CLI (ga4gh-sdk): the device code flow. Copying a token from the dashboard (tes-dashboard#37) is a stopgap.
- Services: client credentials for the services' own tokens (MVP); token exchange (target).
-
Tokens:
- access tokens to APIs;
- ID tokens only inside Krini;
- group memberships from userinfo, or, as a target, from GA4GH Passport visas (
ga4gh_passport_v1).
| Check | Krini | proTES / Conquest (edge) | TES backend, MVP | TES backend, target |
|---|---|---|---|---|
| issuer allowlist | ✓ (ID token) | ✓ | ✓ | ✓ |
signature (JWKS), exp/nbf
|
✓ | ✓ | ✓ | ✓ |
aud |
own client ID | frontend client IDs | — | itself (exchanged token) |
client_id allowlist |
— | frontends (+ Conquest at proTES) | proTES + frontends (direct access) | proTES as act, frontends |
ECP_CLN group |
to show or hide UI | ✓ users | ✓ for user tokens; — for proTES's token (proTES checked it) | ✓ user + node's own policy |
| revocation (introspection) | — | — | — | for expensive operations |
-
Krini:
- LS Login client registration (public client, PKCE, redirect URIs);
- token refresh;
- pass the access token to the Cloud Components;
- show "request compute access" to users without
ECP_CLN.
-
Cloud Components (cloud-components#442): a token callback for each request (bearer), and one retry after a 401.
-
proTES (proTES#201, #202):
- upgrade to FOCA 0.15 to get issuer allowlist, audience, userinfo groups and caching, as in cloud-registry;
- accept users with
ECP_CLNand the Conquest service client; - get its own
client_credentialstoken for TES calls; - put the user's
subin task tags; - discover TES endpoints through the Cloud Registry;
-
task ownership:
- A task submitted with a user token belongs to that user (
sub). - A task submitted with Conquest's service token belongs to the user that Conquest names (e.g. a
submitted_bytag). proTES trusts that tag only from allow-listed service clients (Conquest) and ignores it from users. - Listing and reading tasks with a user token shows only that user's tasks (admins see all). That way the dashboard shows the user their direct tasks and those of their workflows.
- Target: the user's identity comes from the exchanged token (
subplusact= Conquest) instead of a tag.
- A task submitted with a user token belongs to that user (
-
Conquest (generic-issues#18, #27, #28):
- JWT/OIDC validation in Go (e.g.
coreos/go-oidc) with the same edge rules; - its own
client_credentialstoken for calls to proTES; - the user's
subin task tags.
- JWT/OIDC validation in Go (e.g.
-
TES backends (TESK#214, generic-issues#20 Funnel, #21 Poiesis): accept two kinds of tokens, with issuer, signature and expiry checked for both. The existing issues keep "user token +
ECP_CLN" and add the second kind:- user tokens from the frontends:
client_id∈ {Krini, dashboard, CLI}, plusECP_CLN; - proTES's service token:
client_id= proTES.
Tasks created with a user token belong to that user. With a user token, listing and reading tasks shows only that user's tasks; with proTES's token, it shows proTES's tasks. Otherwise a user could see everyone's tasks on that node. Check per backend whether this is supported.
- user tokens from the frontends:
-
Cloud Registry: already done (issuer allowlist, required audience, userinfo groups). Add the Krini/dashboard client IDs to
audiencewhen it's deployed (generic-issues#30). -
Demonstrator dashboard (tes-dashboard#33, #34): same as Krini.
- Token exchange at proTES and Conquest, with an audience for each hop and the
actclaim. - Offline tokens held by Conquest for the duration of a run.
- A backend-for-frontend for Krini.
- Sender-constrained tokens (DPoP or mTLS) between services.
- Per-node policies at TES, using GA4GH Passports and visas.
- Per-user S3 credentials or signed URLs, instead of the shared bucket credentials.
-
Access token format: answered by the Krini sample (JWT per RFC 9068, 4 h,aud=client_id= the client). - Refresh tokens for public clients (
offline_access), their lifetime and rotation; the LS Login session lifetime, which limits silent sign-in. - Can a token carry more than one audience, e.g. Krini's client and an "ELIXIR On-Cloud" resource ID? That would let the edges check a single shared audience instead of a list of frontends.
- Is multi-factor login (
acr= REFEDS MFA) available to require later for admins?