Skip to content

feat(auth): send the user's token to services #44

Closed

Description

@uniqueg

Why?

M4.4 asks for OAuth2-based access control "from client at least to the gateway". The Cloud Components call TES and WES services from the browser, so each request must carry the logged-in user's access token, the services validate it (issuer, signature, expiry, client, compute group), and they act as that user (task ownership). The audience question is settled: services accept tokens issued to Krini's client by listing Krini's client ID (deployment configuration, no Krini code).

How?

  1. Token for the components (decided): tokens stay in the httpOnly cookies of feat(auth): add OIDC login and access tiers #43; the components get the access token through a same-origin route, e.g. GET /auth/api/token → {access_token, expires_at} (Cache-Control: no-store, no CORS, only for a valid session). The components get the token from a callback per request, not once at setup:
  2. Refresh: shortly before exp, renew on the server: with a refresh token (rotated) if the provider issues one to Krini's client, otherwise by silent sign-in (prompt=none, works while the provider session lasts; fall back to a top-level redirect where browsers block third-party cookies). No refresh tokens in the browser.
  3. On 401: renew once and retry the request once; if it fails again, ask the user to log in again. On 403: show "you don't have compute access" with the entry point of feat(auth): link to a compute access request #45 (non-members) or the service's problem detail.
  4. Where the token goes, and where not:
    • only to services from the verified registry list over https (feat: browse services from a registry #40), a gateway or, directly, a verified TES/WES backend;
    • never to the registry's public reads, never to unlisted URLs, never the ID token;
    • no service credentials for user submissions anywhere.
  5. Document which services must list Krini's client ID (audience or client allowlist) and that access tokens must be RFC 9068 JWTs (typ: at+jwt) if a service checks it.

Acceptance criteria

  • Task and workflow submissions to a gateway and to at least one WES service carry the user's bearer token and succeed; the same requests without a token are rejected by those services.
  • A session survives token expiry while the provider session lasts (refresh or silent sign-in), without losing the page.
  • After a 401, exactly one renew and one retry; then a login prompt.
  • No token is sent to registry reads or to services outside the verified list (unit tests).

Dependencies: #43, #40; elixir-cloud-aai/cloud-components#442 (and elixir-cloud-aai/cloud-components#443 for TES). Services: bearer validation in proTES (elixir-cloud-aai/protes#201) and the WES services (elixir-cloud-aai/generic-issues#18, elixir-cloud-aai/generic-issues#19).


Successor of elixir-cloud-aai/tes-dashboard#34 (the TES Dashboard is retired in favour of Krini).

Activity

  1. added
    priority: high
    status: in progress
    type: auth
    workload: days
    ecp-wp4: M4.4
    on Oct 24, 2026
  2. moved this from Backlog to In progress in ELIXIR On-Cloudon Oct 24, 2026
  3. uniqueg commented on Oct 28, 2026

    @uniqueg
    MemberAuthor

    Update on point 1: elixir-cloud-aai/cloud-components#442 is closed. Authentication must use the provider pattern of the Cloud Components; there will be no token property on the components.

  4. added
    status: blocked
    and removed
    status: in progress
    on Nov 14, 2026
  5. added this to the v0.1.0 milestone on Nov 14, 2026
  6. added
    status: in progress
    and removed
    status: blocked
    on Nov 15, 2026
  7. self-assigned this
    on Nov 15, 2026
  8. removed
    status: in progress
    on Nov 15, 2026
  9. AnonymousXC commented on Nov 16, 2026

    @AnonymousXC
    Contributor

    With the v2 architecture of the TES and WES cloud components, bearer tokens are sent to the cloud-components. I strongly believe that the retry logic should be implemented within the cloud component itself. In case of a failure, the cloud component should provide a callback that redirects the user to the login page.

    @uniqueg, please do share your thoughts on this.

    For now, I am closing this issue. I'll reopen it if we decide that any changes are still needed on the Krini side.

  10. moved this from In progress to Done in ELIXIR On-Cloudon Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ecp-wp4: M4.4priority: hightype: authworkload: days

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions