Skip to content

Phase B6: Sign in with NEMAR docs and conformance #2020

Done

Description

@neuromechanist

Goal

After this phase client builders have a public page for NEMAR sign-in, the owner has a gated runbook, a real relying-party library has completed the whole flow against the real routes in an automated test, and the OpenID Foundation conformance suite has been run locally against the provider with its results recorded.
Failures it finds are fixed here or in the owning phase.

Routing

  • Readiness: expand (a planner writes the phase plan as an issue comment; it must settle how the conformance suite runs on this machine, which relying-party library is used, and how a real app session reaches the local website)
  • Implementer: Sonnet
  • Opus checkpoint: review before merge (the conformance results and any fix to B3 or B4 behaviour they force)
  • Depends on: Phase B5: OIDC revocation cascades and back-channel logout #2019 ; Unblocks: the epic to dev pull request
  • Repository and base branch: nemarOrg/nemar-cli (epic branch) for the test and fixes; nemarOrg/docs (base main) for the two pages

Scope

In: the public page, the gated runbook, the end-to-end test, the conformance runs, fixes that they force.
Out: registering any real client; production secrets; the compute routes.

Design references

Design sections 3 and 11; ADR 0119; the docs repository AGENTS.md (public versus gated, pagefind: false); OpenID Connect Core, Discovery, Back-Channel Logout.

Changes

  • Docs repo, src/content/docs/platform/sign-in-with-nemar.md (public; sidebar entry in astro.config.mjs): discovery address, endpoints, flows (code plus PKCE S256 only, client_secret_basic, client credentials for machine scopes), scope and claim tables, sub and what orcid_verified means, token lifetimes, refresh rotation and the 30 second retry, back-channel logout and what a verifier checks, error codes, and how to request a client (name, exact redirect addresses, scopes, logout address, contact). It cites no ADR or .context and names no internal host.
  • Docs repo, src/content/docs/admin/operations/oidc-clients.md (gated, top-level pagefind: false): OIDC_SECRET and its dev twin, key bootstrap and rotation (24 hour rule), registering and disabling a client, secret rotation with grace, the cookie flag order from Phase B1: ADR 0119, partner hosts, __Host- cookie and OIDC subject #2015, the partner host list, the manual merge step (nemar admin oidc end-account), failed logout deliveries, and the checklist before the first production client. Regenerate the command reference with bun run gen:commands after Phase B2: OIDC client registry, signing keys and discovery #2016 and Phase B5: OIDC revocation cascades and back-channel logout #2019 are on dev.
  • nemar-cli test/oidc-e2e.test.ts: a real relying-party library pinned to an exact version at least two weeks old (proposal: openid-client v6, built on oauth4webapi; the plan confirms it runs under Bun and uses its allowInsecureRequests option for the local http issuer) against Bun.serve over freshDb with API_BASE_URL set to the server's own URL. Steps: create the client through the real admin route; seed a person with an ORCID oauth_identities row and a session from issueSession; drive POST /auth/oidc/authorize and /consent as the website page would; redeem with PKCE; verify the ID token against discovery and JWKS; refresh; call userinfo; require the refusal on GET /users/me; revoke the account through the real admin route and require inactive introspection, invalid_grant on refresh, and a back-channel logout request, on a Bun.serve stand-in, that the library's verifier accepts.
  • Conformance: run the suite's basic OP and config OP plans (oidcc-basic-certification-test-plan, oidcc-config-certification-test-plan) against a local backend. The plan must settle the runtime (no container runtime, Maven, MongoDB or Java 17 is installed on the owner's machine today, so an owner-approved user-local install or a different host is required), HTTPS for the issuer if the suite insists, and how the suite's scripted browser signs in through the local website (the dev worker echoes sign-in codes in the response for the nemar.test fixture domain). Record each test's result in the PR as a table; the basic profile must pass, and every warning is explained or fixed.
  • Expected suite findings to check first: the authorize page must accept POST, unknown scopes (address, phone) are ignored, id_token_hint is honoured, a replayed code revokes its tokens. Fix in the owning code with its own test.

Tests (write these first)

  1. The end-to-end test above, red until each step works. Mutation: break the /users/me refusal and the test fails.
  2. The test fails if the logout token is delivered unsigned or to the wrong aud.
  3. Every endpoint, scope and error code on the public page exists in shared/oidc.ts (a nemar-cli test that reads the checked-out page when present, as the copy drift tests do).
  4. The docs site builds with bun run build (admin gating and link checks).

Acceptance criteria

  • The end-to-end test passes against the real routes with an unmodified third-party relying-party library.
  • Conformance basic profile passes; config profile results are recorded and explained.
  • Both pages build; the public one has no internal references.
  • The epic definition of done is met on a local backend plus the local website.

Gates

nemar-cli: bun run typecheck, bun run lint, bun test test/oidc-e2e.test.ts, full bun test. Docs: bun run build, bun test. Website (if touched by a fix): bun run lint, bun run typecheck, bun run test.

Rules that bite here

  • No mocks of NEMAR logic; stand-ins only for the relying party's own endpoints.
  • Public pages carry nothing from ADRs, .context or private repositories.
  • The docs site deploys on every push to main: hold the docs PR until the API release is in production.
  • No dependency may be added unpinned or younger than two weeks.

Escalate to the owner if

  • No container runtime or Java 17 can be set up locally without an install the owner has not approved.
  • The conformance suite cannot reach a local issuer without a public hostname, tunnel or TLS certificate.
  • A conformance failure needs a change to the design (token lifetimes, grace, response modes).

When merged

Mark design sections 3 and 11 implemented with the conformance result, link the runbook from admin/operations/systems-inventory, and open the epic to dev pull request with the results table.

Activity

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

    @neuromechanist
    ContributorAuthor

    Owner decisions on the B6 decision page, recorded here so the issue matches the plan.

    • Decision 1 (runtime): a GitHub-hosted runner first. nemaring is the fallback if performance becomes a problem.
    • Decision 2 (certificate): a self-signed certificate created inside the runner is allowed.
    • Decision 3 (design conflicts): PKCE stays mandatory, client_secret_post stays refused, and ES256 stays the only signing algorithm. Each resulting conformance failure is recorded as deliberate.
    • Decision 4 (acceptance wording): approved as proposed.
    • Decision 5 (pins): openid-client 6.8.9, by the owner's exception to the two-week rule for this package. oauth4webapi 3.8.8 and jose 6.2.12 are unchanged.
    • Decision 6 (retention): the code defaults stay (sent and fenced 30 days, failed 180 days). The owner confirms them before the first client is registered.
    • Decision 7 (website POST): option W1. The website turns off the framework's origin check and adds its own check that exempts only the authorization POST. The consent POST stays same-origin. This is a separate slice (S6), and it needs the website pull request merged and an Opus review.
    • Decision 8 (key recovery): the by-hand recovery is documented. The ADR 0119 sentence about a re-encryption path is amended to match the code.
    • Decision 9 (drift test): stays in the documentation repository.
    • Decision 10 (preconditions): the website pull request merges with this epic, before the API release that needs it. The documentation pull request stays a draft until the API release is in production. ADR 0119 is accepted at the end of this phase, after the conformance results and the amendment are in.

    Next: the fix round on the nemar-cli and documentation pull requests, a delta review, and the merge of the nemar-cli pull request into the epic. Then the runner rig and the configuration smoke run (S4), the Basic plan run (S5), the website change (S6), the run against the real page (S7), and the final cleanup (S8).

  3. neuromechanist commented on Nov 26, 2026

    @neuromechanist
    ContributorAuthor

    Done: the end-to-end test with openid-client (#2048), the conformance rig and run (#2049, results recorded there; the deliberate PKCE, client_secret_post and ES256 refusals per the owner's decisions of 2026-11-05), the public page and gated runbook (nemarOrg/docs#101, #104). Released with the epic in 0.10.33 (2026-11-11).

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

    featurehpc

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions