Skip to content

feat(auth): support service tokens and roles #340

Closed

Description

@uniqueg

Why?

In ELIXIR On-Cloud, services call each other with their own tokens (OAuth 2.0 client credentials), e.g. Conquest → proTES and proTES → TES, because user tokens expire during long runs. Such tokens represent a client, not a user: they have no user info and no group entitlements. FOCA currently fetches user info when configured claims (e.g. the group claim) are missing; for a service token that fails or yields nothing, and access control can't give the client a role except through its sub as a user.

How?

  1. Recognise service tokens (e.g. sub equals client_id, or a configured list of service clients) and skip the user info request for them.
  2. Let access control map clients to roles (e.g. a client_mapping next to group_mapping, giving client:<id> subjects), so an app can say "Conquest's client may create tasks".
  3. Optionally let allow-listed service clients name the user they act for (e.g. a request header or field configured by the app), so that apps can attribute ownership to that user. Example: proTES makes the user that Conquest names the owner of the task. Other callers can't do this; their value is ignored or rejected. Token exchange with an act claim can replace this later.
  4. Document how to combine this with the client allowlist (feat(auth): allow-list token clients #339).

First check what LS Login's client-credentials tokens contain (sub, client_id, aud, lifetime) and whether its user info endpoint answers for them.

Acceptance criteria

  • A valid client-credentials token is accepted without a user info request, and its client gets the mapped role; tests cover it.
  • User tokens behave as before.

Activity

  1. added
    priority: medium
    status: triage
    type: auth
    type: feature
    workload: days
    on Oct 21, 2026
  2. added
    status: blocked
    and removed
    status: triage
    on Oct 21, 2026
  3. added
    status: in progress
    and removed
    status: blocked
    on Oct 21, 2026
  4. uniqueg commented on Oct 22, 2026

    @uniqueg
    MemberAuthor

    Done in #371.

  5. removed
    status: in progress
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumtype: authtype: featureworkload: days

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions