Frontends
Nod's own pages (sign-in, account, device approval, invitations, password reset) are served by the Nod server today. They are moving to React Router apps rendered on the server and published to Astropause, which now serves custom domains with per-path routing: the page paths go to the app, everything else to Nod, all on the issuer's own domain (passkeys need that). These endpoints are what a frontend (ours, or your own) builds on.
Before anyone signs in
GET <issuer>/ui/config?client_id=web&organization=initech
{
"realm": { "id": "acme", "name": "Acme", "issuer": "https://auth.example.com/acme" },
"branding": { "logo_url": null, "accent_color": "#ff6600", "background_color": null,
"sign_in_heading": null, "terms_url": null, "privacy_url": null },
"sign_in": { "passkeys": true, "passwords": false, "sign_up": true },
"client": { "id": "web", "name": "Acme web" },
"organization": { "id": "initech", "name": "Initech" },
"connections": [{ "id": "initech-okta", "name": "Initech SSO",
"start": "https://auth.example.com/acme/federation/initech-okta/start" }]
}
- Public by nature: it's what the sign-in page shows anyway. It needs no credentials and holds no secret. Machine clients don't appear, since no one signs in to them.
- Organization-aware: with
organization=,connectionslists only that organization's own (see Organizations). - Not cached (
Cache-Control: no-store): branding and sign-in options change, and responses shouldn't go stale in shared caches.
Drop-in components for your own React app
sdks/react (@nod/react, unpublished) is the Clerk-style side: <NodProvider>, <SignInButton>, <UserButton>, <OrganizationSwitcher>, useUser(), useAuth() and useOrganization() in your own app. They are components of your page, but sign-in is not: they redirect to the hosted page above and never collect a password (Clerk's redirect mode, not its embedded forms), and tokens stay in memory. See its README for the quickstart and decisions.md (2026-12-02) for why.
Nod's own React app
ui/ in the repository is the sign-in page as a server-rendered React Router app for Astropause. It uses only what this page describes. Its README shows how an operator routes the issuer's domain to it.
The sign-in page: /authorize as JSON
The frontend owns <issuer>/authorize. Its loader asks Nod the same request with Accept: application/json, forwarding the browser's query string and cookies, and following no redirects:
const r = await env.HARPORA.fetch(`http://harpora/acme/authorize${url.search}`, {
headers: { accept: "application/json", cookie: request.headers.get("cookie") ?? "",
"x-astropause-client": request.headers.get("x-astropause-client") ?? "" },
redirect: "manual",
});
if (r.status >= 300 && r.status < 400) return r; // back to the app: a code, or an error for it
if (!r.ok) return { error: (await r.json()).error_description }; // shown, never sent back to the app
return await r.json(); // the sign-in page
Nod decides exactly as for its own page: an already signed-in person goes straight back to the app with a code, errors that belong to the app go back to it, and errors that mustn't (an unknown client, a redirect URI it didn't register) are shown, here as 400 {"error", "error_description"}. Otherwise:
{
"client_name": "Acme web",
"request": { "client_id": "web", "redirect_uri": "https://app.acme.example/cb", "state": "…", "…": "…" },
"connections": [{ "id": "corp", "name": "Corp SSO", "start": "federation/corp/start?client_id=web&…" }]
}
- **
requestgoes back untouched** inPOST <issuer>/authorize/completeonce the person has signed in (passkey or password, through the same JSON endpoints Nod's page uses). A pushed or signed request has been resolved already, so this is what Nod validated. - A Cancel button posts the same
requesttoPOST <issuer>/authorize/cancel(same origin, no session needed) and sends the browser to theredirectit answers: back to the app witherror=access_deniedand itsstate. Nod's own page has one. - **
client_nameis the client's, raw:** render it as text, never as HTML. - **
connectionsare already filtered** for the organization, and theirstartlinks (relative to the issuer) carry the request. - Never cached (
no-store,Vary: Accept, Cookie). Branding and the sign-in options come fromui/config.
The device page: /device as JSON
GET <issuer>/device?user_code=… with Accept: application/json (cookies forwarded) answers 401 {"error": "login_required"} before anyone is signed in, 404 for a code that isn't pending (or belongs to someone else's backchannel request: the same answer), and otherwise {"client_name", "scope", "binding_message"}. The decision is POST <issuer>/device/decision {"user_code", "approve"}, as Nod's own page sends it.
Password reset and invitations
GET <issuer>/password/reset?token=… with Accept: application/json answers 200 {"live": true} or 404; the new password goes to POST <issuer>/password/reset {"token", "password"}. GET <issuer>/invitation?token=… answers 404 for a used, withdrawn or expired invitation, 401 before sign-in, and otherwise {"organization", "email"}; accepting is POST <issuer>/invitation/accept {"token"}, by the account with that verified address.
Signing out
GET <issuer>/logout?… with Accept: application/json does what Nod's page does: with an id_token_hint for the signed-in person (or nobody signed in) it signs out and redirects (or answers Nod's "signed out" page), clearing the session cookie, so pass its Set-Cookie on. When the request doesn't prove which app sent it, it answers {"confirm": true, "request": {…}}; post that request to <issuer>/logout/confirm once the person says yes.
The account page's data
GET <issuer>/account with Accept: application/json answers 401 {"error": "login_required"} before anyone is signed in, and otherwise the page's state: username, passkeys (ids and dates), password, passwords_enabled, totp, recovery_codes_left, external (linked accounts), connections (ones that could be linked) and recent (whether changes are allowed without signing in again). The changes are the same JSON POSTs Nod's own page makes (account/passkey/start|finish|remove, account/password, account/totp/start|confirm|remove|recovery-codes, account/link/{connection}, account/unlink).
Signed-in, same-origin JSON a frontend's account page uses (cookies as the browser sends them):
GET <issuer>/account/sessions: the person's sessions, the one asking markedcurrent.POST <issuer>/account/sessions/endwith{"sid": "…"}(sign out that device) or{"others": true}(every other one). It needs a recent sign-in. Only the person's own sessions can be ended, and their apps are told.
- A third-party app the person hasn't agreed to:
GET /authorize(as JSON) answersconsent(client_name,client_id,scopes, each withscopeand, for the standard ones, atext_keysuch asconsent.scope_email) with therequest, andPOST /authorize/completeanswers{"consent": …}instead of a redirect. Show what it asks for, as text; Allow postsauthorize/completeagain with"consent": true(and theorganizationchosen, if any); Deny postsauthorize/cancel. - Any app answered at a loopback or private-use redirect (apps): the same
consent, every sign-in. For the realm's own app it has"first_party": trueanduser(the username signing in): nothing to approve, so ask "Continue to {app} as {username}?" (confirm.title,confirm.sub,confirm.continue,confirm.cancelin the realm's text); Continue posts"consent": trueas Allow does, and Cancel postsauthorize/cancel.
POST <issuer>/account/export: everything Nod holds about the person, as one JSON document (GDPR access and portability). It needs a recent sign-in, and the security log recordsuser.exported.POST <issuer>/account/apps/revokewith{"client_id": "…"}: takes that app's access back (its grants and the person's consent; the account state lists them asapps). It needs a recent sign-in.POST <issuer>/account/deletewith{"username": "…"}(theirs, typed again): deletes the person's account, where the realm allows it (self_deletein the account state; otherwise 403). It needs a recent sign-in; it answers 204 and clears the session cookie.
Rules for any frontend
- Serve the pages from the issuer's own origin. Passkeys bind to that domain, and Nod's session cookie, same-origin checks and CSRF defences assume it.
- Keep the browser's requests going to Nod directly (sign-in, passkey ceremonies, account changes). A server-side renderer may read through Nod's API, forwarding the browser's cookies as they are, but must never act on a person's behalf without them.
- Keep the page locked down: a CSP with a per-response nonce, no framing,
no-store. - Answer a challenge. With bot detection on,
POST password/sign-in,passkey/start-sign-upandpassword/forgotmay answer428with{"error": "challenge_required", "challenge": "…", "difficulty": 12}. Find a decimalnoncesuch that SHA-256(<challenge>:<nonce>) starts withdifficultyzero bits, then send the same request again with the headerNod-Proof-Of-Work: <challenge>:<nonce>. Show that something is happening: at 17 bits it takes a second or two. - **Pass the request to
email/start.** With email codes on, send{"email", "request"}, the authorization request your page shows, so the emailed sign-in link can bring the person back to it.