Skip to content

feat(auth): accept tokens of allow-listed clients #153

Closed

Description

@uniqueg

Why?

With auth on, tesk-api validates every token at the user info endpoint of the identity provider and authorizes the user by groups or a claim of the user info. Gateways and other services call TES with tokens of their own, obtained with the OAuth 2.0 client credentials grant (RFC 6749, section 4.4), e.g. the proTES gateway with auth: client_credentials for its backends. Such tokens have no user: the user info endpoint may refuse them, and even if it answers, it releases no groups. So a TESK with auth can't be used behind a gateway, and operators have to choose between leaving TESK open and not offering it through a gateway.

Proposed solution

An optional allow-list of clients whose access tokens tesk-api accepts without the user info:

  • Settings (off by default): the issuer, the JWKS URI (default: from the issuer's OpenID Connect discovery document), the claim that names the client (default client_id, RFC 9068; some providers use azp), and the list of client IDs.
  • A bearer token that is a JWT is checked locally first: signature against the issuer's JWKS (keys cached, refreshed for an unknown key ID), exact iss, exp and nbf (small leeway), and the client claim in the list. If all hold, the request is authenticated as that client. Otherwise (no JWT, other issuer, client not listed) the token goes the existing way through the user info endpoint, so user tokens keep working as before.
  • Authorization of such a client: it may create tasks, and list, get and cancel the tasks it created. No group rules apply; the client is a principal of its own (e.g. labelled with the client ID, without a team).
  • Optional: require the header typ: at+jwt (RFC 9068, section 4), so that ID tokens aren't accepted as access tokens.
  • Log the client ID (not the token) for accepted and refused service tokens.

Tests and docs

  • Unit tests with tokens signed by a test key and a local JWKS: accepted client, unlisted client, other issuer, expired, bad signature, unknown key ID (refresh), non-JWT token falling through to the user info path.
  • An integration test of the API with both kinds of tokens (service and user).
  • docs/access-control.md (a section on tokens of services, with the trust implications: every holder of a listed client's credentials can run tasks), docs/configuration.md (the settings), and the release notes.

Acceptance criteria

  • With the setting on, a token of a listed client creates, lists, gets and cancels its own tasks without a user info call; unlisted clients and invalid tokens get 401.
  • With the setting off, behaviour is unchanged.
  • Docs and tests as above.

Activity

  1. added
    type: feature
    priority: high
    status: triage
    workload: days
    on Nov 12, 2026
  2. moved this from Backlog to Ready in ELIXIR On-Cloudon Nov 12, 2026
  3. added
    status: in progress
    and removed
    status: triage
    on Nov 12, 2026
  4. self-assigned this
    on Nov 12, 2026
  5. moved this from Ready to In progress in ELIXIR On-Cloudon Nov 12, 2026
  6. moved this from In progress to Done in ELIXIR On-Cloudon Nov 12, 2026
  7. removed
    status: in progress
    on Nov 13, 2026
  8. added this to the v2.0.0 milestone on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: hightype: featureworkload: days

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions