Skip to content

Epic: NEMAR sign-in: an OpenID Connect provider #2014

Done
6 of 6 issues completed
Done

Description

@neuromechanist

Goal

NEMAR becomes a general OpenID Connect (OIDC) provider.
After this epic any registered service can sign people in with their NEMAR account using the authorization code flow with Proof Key for Code Exchange (PKCE), read their claims, refresh, be told when an account is revoked, and be refused everywhere else in the NEMAR API.
compute.nemar.org (a Drupal site run by the San Diego Supercomputer Center with the stock OpenID Connect module) is the first client, not the only one: nothing in the provider may name it except the partner host list and the documentation.
ORCID (Open Researcher and Contributor ID) stays the identity underneath; NEMAR adds what it knows about the account.

Why

The compute gateway needs people to sign in at a site NEMAR does not run, and needs that site to act for the person without ever holding a NEMAR API key (which carries the account's full authority and has no scopes).
OIDC with short-lived, scope-bound, audience-bound opaque access tokens gives that boundary.
Building it as a general provider means the next service (a private site, a workshop host, a partner tool) joins by registration rather than by new code.
The issuer can never change once a client trusts it, so the decisions are fixed in an Architecture Decision Record (ADR) before the first client registers.

Phases

Order is linear: #2015 then #2016 then #2017 then #2018 then #2019 then #2020.
#2015 is the largest Sonnet phase; if its review finds the cookie work (two repositories) is crowding the rest, the cookie change may be split into its own phase B1b before #2016 starts.

Reserved numbers and branches

Cross-epic and release notes

  • test/adr-index.unit.test.ts requires ADR numbers to be gapless from 0001. While ADR 0118 (Epic A) is absent from dev, ADR 0119 fails that test; Phase B1: ADR 0119, partner hosts, __Host- cookie and OIDC subject #2015 adds a tolerated-gap list for 118 and removes the entry in the same PR that adds the file, whichever epic lands second.
  • Both epics add adminCommand.addCommand(...) lines in src/commands/admin.ts and entries in test/admin-route-inventory.unit.test.ts; expect a trivial merge conflict, resolved by keeping both.
  • The session cookie rename is released in two steps so the website and the API cannot disagree: the website reads both names first, the API sets the new name only where HOST_PREFIXED_SESSION_COOKIE is "1" (dev first), and the owner turns it on in production after the website release is live. Registering any partner client in production waits for that.
  • The documentation PR in Phase B6: Sign in with NEMAR docs and conformance #2020 merges only after the API release that contains the epic is in production, because the docs site deploys on every push to main.
  • New Worker secret, set by the owner and never by an agent: OIDC_SECRET (production and dev, different values). Until it exists every OIDC surface answers 404.
  • The partner list starts with compute.nemar.org only; its staging counterpart is added when the SDSC team names it.

Definition of done

On a local backend plus the local website, a test relying party completes code plus PKCE sign-in for an account with a proven ORCID, refreshes, calls userinfo, is refused on /users/me with its access token, and loses its tokens and receives back-channel logout when the account is revoked.
The OpenID Foundation conformance suite's basic and config OP profiles are run locally and the basic profile passes, with results recorded in the #2020 PR.
Every phase gate is green and the full bun test is green on the epic branch.
Only then is the epic to dev pull request opened, and only that pull request waits for full green CI.

Out of scope

Public (secretless) clients, private_key_jwt, dynamic client registration, RP-initiated logout, a self-service "connected apps" page where a person revokes a grant, front-channel logout, and anything that consumes compute.* scopes (the routes that serve them belong to the compute epics). Each is a later decision; the ADR lists them as not decided.

References

  • Design: the gated page admin/design/compute-gateway in nemarOrg/docs (file src/content/docs/admin/design/compute-gateway.md), section 3 is authoritative; read it with nemar admin docs admin/design/compute-gateway.
  • Implementation notes: .context/compute-program/implementation-notes.md on nemarOrg/nemar-cli dev, beside the roadmap .context/compute-program/README.md.
  • Closest existing patterns: ADR 0056 and ADR 0079 (host-scoped handoff with a 60-second hashed code), ADR 0078 (service binding), backend/src/services/docs-auth.ts, backend/src/routes/auth-private.ts, website src/pages/auth/private/authorize.astro.

Sub-issues

Sub-issues

6 of 6 Issues completed
Loading 6 sub-issues

Activity

  1. added
    feature
    on Nov 4, 2026
  2. neuromechanist commented on Nov 26, 2026

    @neuromechanist
    ContributorAuthor

    All six phases are done (#2015 to #2020). The epic merged into dev in #2060 and shipped in 0.10.33 (2026-11-11). Turning sign-in on in production stays the owner's switch: OIDC_SECRET and HOST_PREFIXED_SESSION_COOKIE as the 0.10.33 notes describe, and no partner client is registered until then.

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

    epicfeaturehpc

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions