Repository navigation
Description
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
- Phase B1: ADR 0119, partner hosts, __Host- cookie and OIDC subject #2015 ADR 0119 and hardening: partner host list,
__Host-session cookie,users.oidc_subject - Phase B2: OIDC client registry, signing keys and discovery #2016 Clients and signing keys: discovery, JWKS, owner routes and
nemar admin oidc clients|keys - Phase B3: OIDC authorization and consent #2017 Authorization: backend authorize and consent routes, codes, grants, website
/oauth/authorizepage - Phase B4: OIDC token, userinfo, revocation and introspection #2018 Token endpoint, userinfo, revocation, introspection,
oidcBearerand the refusal everywhere else - Phase B5: OIDC revocation cascades and back-channel logout #2019 Revocation cascades, client disable, back-channel logout sender
- Phase B6: Sign in with NEMAR docs and conformance #2020 Documentation, end-to-end test with a real relying-party library, OpenID Foundation conformance run
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
- Migrations (Epic B owns 0120 to 0124): 0120
users.oidc_subject(Phase B1: ADR 0119, partner hosts, __Host- cookie and OIDC subject #2015), 0121oidc_clientsandoidc_signing_keys(Phase B2: OIDC client registry, signing keys and discovery #2016), 0122oidc_grantsandoidc_codes(Phase B3: OIDC authorization and consent #2017), 0123oidc_tokens(Phase B4: OIDC token, userinfo, revocation and introspection #2018), 0124oidc_logout_deliveries(Phase B5: OIDC revocation cascades and back-channel logout #2019). - ADR: 0119, "NEMAR is an OpenID Connect provider and ORCID stays the upstream identity" (Phase B1: ADR 0119, partner hosts, __Host- cookie and OIDC subject #2015). ADR 0118 belongs to Epic A.
- Repositories and bases:
nemarOrg/nemar-cli(integration branchdev),nemarOrg/website(integration branchstaging, one cookie PR in Phase B1: ADR 0119, partner hosts, __Host- cookie and OIDC subject #2015 and one page PR in Phase B3: OIDC authorization and consent #2017),nemarOrg/docs(basemain, Phase B6: Sign in with NEMAR docs and conformance #2020). - Epic branch:
feature/issue-#2014-epic-oidc-provider, branched fromdev. Phase branches branch from it and squash-merge into it. Website and docs phase PRs target their own base branches. - Batch 1, in parallel with Epic A. The two epics share no migration, ADR or route prefix; see the cross-epic notes below for the two places they touch the same file.
Cross-epic and release notes
test/adr-index.unit.test.tsrequires ADR numbers to be gapless from 0001. While ADR 0118 (Epic A) is absent fromdev, 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 insrc/commands/admin.tsand entries intest/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_COOKIEis"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-gatewayin nemarOrg/docs (filesrc/content/docs/admin/design/compute-gateway.md), section 3 is authoritative; read it withnemar admin docs admin/design/compute-gateway. - Implementation notes:
.context/compute-program/implementation-notes.mdon nemarOrg/nemar-clidev, 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, websitesrc/pages/auth/private/authorize.astro.
Activity
docs: add compute program roadmap and playbook (#2027)
Epic: NEMAR sign-in as an OpenID Connect provider (#2014) (#2060)
neuromechanist commentedon Nov 26, 2026
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_SECRETandHOST_PREFIXED_SESSION_COOKIEas the 0.10.33 notes describe, and no partner client is registered until then.