Skip to content
Alex Kanitz edited this page Oct 21, 2026 · 1 revision

Authentication and authorization across ELIXIR On-Cloud services

1. Scope

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.

2. What LS Login offers

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 (PKCE S256), refresh_token, client_credentials, urn:ietf:params:oauth:grant-type:token-exchange, device_code, and implicit, which we don't use.
  • Scopes: offline_access and eduperson_entitlement. The latter is where group memberships such as ECP_CLN come 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.
  • iss is LS Login's issuer.
  • aud and client_id are both Krini's client ID. There's no azp claim and no other audience.
  • scope: openid profile email eduperson_entitlement ga4gh_passport_v1. There's no offline_access, so Krini most likely gets no refresh token.
  • Lifetime 4 h (exp - iat = 14,400 s).
  • acr is https://refeds.org/profile/sfa, i.e. single-factor login.
  • sub is the user's LS ID (…@lifescience-ri.eu).
  • No group claims in the token: ECP_CLN has 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/resource parameters, and which audience the issued tokens get;
  • how service (client_credentials) tokens look: their client_id, aud and lifetime.

3. Principles (both MVP and target)

  1. 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.
  2. Access tokens go to APIs; ID tokens never do. The ID token is only for Krini's own login session.
  3. Every service validates every request. No service relies on "the caller already checked". How strict the check is depends on the hop (§6).
  4. 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 which aud a TES backend should expect. The user's identity travels as data: the sub goes into TES task tags for accounting and audit.
  5. Group-based authorization. Users need the ECP_CLN entitlement to run compute, and ECP_CLN:ADMIN for admin actions. Entitlements are read from userinfo and cached for at most 5 minutes, as cloud-registry does with FOCA 0.15.
  6. Short-lived tokens, refreshed by the party that holds them. No service stores a user's refresh token in the MVP.

4. MVP ("get the job done")

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), not azp. In the table, "azp" means the client_id claim. At the edges, aud = the frontend's client ID, which is what LS Login issues today.
  • The aud problem 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 sub in 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 tags with the user's sub (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.

4a. Service discovery through the Cloud Registry

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} and GET /services/types are 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's audience must 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.ga4gh tes/wes, with the version) and environment (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.
  • 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.

5. Answers to the questions

5.1 Which issuers are trusted

  • 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.

5.2 Configuring aud

  • MVP:
    • The edges (proTES, Conquest) require aud (or azp, 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 check azp ∈ {proTES} (§4).
  • 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 an act claim (the "actor", proTES).
    • Every service checks that aud is itself, and a token stolen at one service can't be used at another.

5.3 When tokens expire

  • 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).
  • Services: no user tokens are stored. Long-running work uses service tokens (§4).
  • Target:
    • Conquest exchanges the user's token for an offline_access refresh 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.

5.4 Which OIDC flow and which tokens

  • 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 HttpOnly session 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).

5.5 Where tokens are validated, and how strictly

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

6. Per component (to turn into issues)

  • 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_CLN and the Conquest service client;
    • get its own client_credentials token for TES calls;
    • put the user's sub in 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_by tag). 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 (sub plus act = Conquest) instead of a tag.
  • Conquest (generic-issues#18, #27, #28):

    • JWT/OIDC validation in Go (e.g. coreos/go-oidc) with the same edge rules;
    • its own client_credentials token for calls to proTES;
    • the user's sub in task tags.
  • 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:

    1. user tokens from the frontends: client_id ∈ {Krini, dashboard, CLI}, plus ECP_CLN;
    2. 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.

  • Cloud Registry: already done (issuer allowlist, required audience, userinfo groups). Add the Krini/dashboard client IDs to audience when it's deployed (generic-issues#30).

  • Demonstrator dashboard (tes-dashboard#33, #34): same as Krini.

7. From MVP to target

  1. Token exchange at proTES and Conquest, with an audience for each hop and the act claim.
  2. Offline tokens held by Conquest for the duration of a run.
  3. A backend-for-frontend for Krini.
  4. Sender-constrained tokens (DPoP or mTLS) between services.
  5. Per-node policies at TES, using GA4GH Passports and visas.
  6. Per-user S3 credentials or signed URLs, instead of the shared bucket credentials.

8. To check with LS Login before implementing

  • 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?