Test mode: paid plans aren't on sale yet, so nothing is charged. Every plan's limits apply.

← Docs

Sign-in methods

Passkeys (the default)

People create an account with a username and a passkey (Face ID, Touch ID, Windows Hello, a security key, a phone nearby), then sign in with it. Passkeys need no second factor: they prove both that the person holds the key and that they unlocked it (user verification is required).

Every passkey is bound to the site (the RP ID, which is the public URL's host), so a phishing site can't use it.

Passwords, and authenticator apps

Off by default. Turn them on per realm:

nod realm set acme --passwords on

Authenticator apps (TOTP) add a second factor to password sign-in. After the password, the page asks for the 6-digit code, and the person isn't signed in until it's right. Each code works once, ten wrong codes lock it for 15 minutes, and the secret is sealed at rest.

Recovery codes stand in for a lost phone. Turning an app on gives ten codes (XXXX-XXXX-XXXX-XXXX), shown once. Each works once in place of the app's code, typed in any case, with or without dashes. Wrong ones count toward the same lockout. Only their hashes are stored. The account page shows how many are left and makes a new set on request, and the old set then stops working. Signing in with one answers recovery_codes_left.

Requiring a second factor

nod realm set acme --require-mfa on
# or: PATCH $ISSUER/api/v1/realm {"require_mfa": true}

Every sign-in with a password (or an emailed code) then needs a second factor (Auth0's "require MFA: always"):

Email

Nod sends password-reset links, and verification links from the account page ("verify my email"), through SMTP ($NOD_SMTP_URL, smtps://user:pass@host:465, or --smtp for a server without a password: a password there is refused, since the process list would show it), from --mail-from. In development, --mail-dir DIR writes each message as an .eml file instead. Links are always built from --public-url.

New devices (adaptive MFA)

nod realm set acme --adaptive-mfa on
# or: PATCH $ISSUER/api/v1/realm {"adaptive_mfa": true}

A stolen password is worth much less if it only works from the person's own devices. With adaptive MFA on, a password sign-in from a browser the person hasn't signed in from before emails a six-digit code to their verified address, and the sign-in finishes only with it. The email also says what happened, so if it wasn't them, they know to change their password.

Sign-in codes by email (passwordless)

nod realm set acme --email-codes on
# or: PATCH $ISSUER/api/v1/realm {"email_codes": true}

The sign-in page then offers "Email me a sign-in code". Someone types their email address and gets a six-digit code, which signs them in. Only an account's verified address gets one, and the page says the same whatever address is typed, so it never tells anyone which addresses have accounts.

Text-message (SMS) codes

SMS is the weakest second factor Nod offers, and it is off until a realm turns it on. A number can be moved to an attacker's SIM (a SIM swap, or a port-out the carrier is talked into), and texts can be read off the phone network (SS7) or a lock screen: NIST SP 800-63B calls it a restricted authenticator. Prefer passkeys, then an authenticator app; offer SMS to people who have neither. Nod's pages offer it last, and the account page says why.

It needs an SMS provider on the server (operating.md). Without one, or in a realm that allows no country, SMS is simply not there: no method on the sign-in page, no phone on the account page, its routes answer 404, and someone with a number signs in as if they had none. It is never an error at sign-in.

nod realm set acme --sms-countries +61,+64 --sms-mfa on          # a second factor
nod realm set acme --sms-sign-in on                              # and a way to sign in
nod realm set acme --sms-daily-cap 500                           # texts a day at most (default 1,000)
# or: PATCH $ISSUER/api/v1/realm {"sms_countries": ["+61"], "sms_mfa": true, "sms_sign_in": true, "sms_daily_cap": 500}

The account page

At <issuer>/account, people manage their own sign-in methods: add and remove passkeys, set a password (where the realm allows them), set up or remove an authenticator app, add, verify, replace or remove a phone number for text-message codes (where offered), and link or unlink outside accounts. Every change needs a sign-in from the last 10 minutes (otherwise the page asks them to sign in again), and the last remaining way to sign in can't be removed. Administrators can do the same through the management API.

The page also shows their recent activity: the last 20 entries of the security log about them (sign-ins, failures, lockouts, new devices, changes), newest first, with the address each came from, so they can spot use that wasn't theirs. Administrators' changes aren't listed there (they are in the person's data export).

Apps with access lists every app that can still get tokens for them (an active grant) or gets in without asking (their consent, for a third-party app), with what it may have and since when. "Remove access" revokes that app's grants (its refresh tokens stop working and its access tokens introspect as inactive at once) and withdraws their consent, so a third-party app asks again; other apps keep theirs. The security log records grant.revoked.

Outside providers (connections)

echo "$PROVIDER_CLIENT_SECRET" | nod connection add acme google \
  --issuer https://accounts.google.com --client-id 123.apps.googleusercontent.com --scope email --scope profile --name Google \
  --verified-domain acme.example

Straight to a provider

Two ways to skip the sign-in page and its button:

Either way the provider handles prompt and account choice, and the round trip ends with a code for the app, as a click on the button would. Someone already signed in isn't sent anywhere.

Sign in with Apple

Apple speaks OpenID Connect, but its client secret is a JWT signed with your private key, and it posts the code back. So it's its own kind of connection, and Nod makes the secret itself:

nod connection add acme apple --apple --client-id com.example.web --team-id ABCDE12345 --key-id KEY1234567 < AuthKey_KEY1234567.p8

GitHub

GitHub speaks OAuth 2.0 but not OpenID Connect, so it is its own kind of connection:

echo "$GITHUB_CLIENT_SECRET" | nod connection add acme github --github --client-id Iv1.0123456789abcdef
# GitHub Enterprise Server: add --issuer https://github.example.com

Other OAuth 2.0 providers

Providers that speak plain OAuth 2.0, without OpenID Connect (Discord, X, Amazon, Spotify and many more), are a connection of kind oauth2. Give its endpoints, which these providers don't publish, and where its userinfo answer keeps the person:

echo "$DISCORD_CLIENT_SECRET" | nod connection add acme discord --oauth2 --name Discord \
  --issuer https://discord.com --authorize https://discord.com/oauth2/authorize \
  --token https://discord.com/api/oauth2/token --userinfo https://discord.com/api/users/@me \
  --client-id 1234567890 --scope identify --name-pointer /global_name

LDAP and Active Directory

A company's directory can check its people's passwords itself. They sign in on Nod's own page with their directory email address and password. There is no redirect, and the directory is never shown a token.

echo "$SERVICE_ACCOUNT_PASSWORD" | nod connection add-ldap acme corp --url ldaps://dc1.corp.example \
  --base-dn "ou=people,dc=corp,dc=example" --bind-dn "cn=harpora,ou=services,dc=corp,dc=example" \
  --domain corp.example --ca corp-ca.pem --name "Corp directory"

SAML 2.0

A company whose identity provider speaks SAML (ADFS, Okta, Ping, Shibboleth, Entra ID) can sign its people in through it. Nod is the service provider; the IdP's administrator gives you three things:

nod connection add-saml acme corp --entity-id https://idp.corp.example/metadata \
  --sso-url https://idp.corp.example/sso --cert idp-signing.pem --name "Corp"

and loads Nod's metadata from $ISSUER/federation/saml-metadata (or types it in: the entity ID and the assertion consumer service are both $ISSUER/federation/callback, HTTP-POST binding).

Branding

A realm's pages (sign-in, account, device approval, invitations) can carry its look:

nod realm set acme --logo https://cdn.acme.example/logo.svg --accent '#ff6600' --background '#fafafa' \
  --heading "Welcome to Acme" --terms https://acme.example/terms --privacy https://acme.example/privacy
# or: PATCH $ISSUER/api/v1/realm {"branding": {"accent_color": "#ff6600", …}}; "" clears a field

Your own wording, per language

The sign-in page's text, and the sign-out, password-reset, invitation, device and account pages' (logout.*, reset.*, invitation.*, device.*, account.*), can be the realm's own, in any language the realm writes it in:

curl -X PUT "$ISSUER/api/v1/realm/text/de" -H "Authorization: Bearer $T" -H 'content-type: application/json' \
  -d '{"text": {"signin.title": "Bei {app} anmelden", "signin.submit": "Anmelden"}}'

Realm policies

How long people stay signed in: nod realm set acme --session-hours 8 (or PATCH /realm {"session_hours": 8}): from 1 hour to 30 days, 12 by default (0 puts it back). It is the browser session's whole life, from signing in (Auth0's maximum session lifetime); an app's own refresh tokens follow their own rules. --session-idle-hours 2 (session_idle_hours) also ends a session unused for that long (Auth0's idle session lifetime; 0, the default, is none; at most session_hours). Use is noted at most every tenth of that window, so an idle session can last up to a tenth longer than the setting.

Deleting their own account: nod realm set acme --self-delete on ("self_delete": true) adds "Delete your account" to the account page (the right to erasure, done by the person). Off by default, because in many apps an account must stay for others' records; with it off, an administrator deletes accounts (DELETE /users/{id}). The person types their username to confirm, after a recent sign-in. Their apps' grants are revoked (access tokens introspect as inactive at once), every session ends (apps with back-channel logout are told), and the account goes with its passkeys, password, authenticator app, links and memberships. The security log keeps user.deleted ("by the person") and their earlier entries until they age out.

nod realm set acme --sign-up off       # only administrators create users
nod realm set acme --passwords off

Policies are checked where the action happens, not just on the page. A passkey sign-up started before sign-up was turned off can't finish.

Bot detection

nod realm set acme --bot-detection risky    # or: always, off (the default)
# or: PATCH $ISSUER/api/v1/realm {"bot_detection": "risky"}

Credential stuffing and sign-up spam are cheap because each try costs the attacker nothing. With bot detection on, a password sign-in, a self sign-up and a password reset request each first need a solved proof-of-work challenge. The browser finds a number whose SHA-256, together with the challenge, starts with enough zero bits. That takes a person's browser a moment, and costs a run of thousands of guesses real computing time. Nothing goes to an outside CAPTCHA service, and nobody is tracked or shown a puzzle.

Nod's sign-in page solves challenges by itself. Another frontend follows the contract. Passkey sign-ins need no challenge: there is no password to guess.

How the app knows

The ID token's acr says how the person signed in: urn:harpora:passkey, urn:harpora:password, urn:harpora:password-otp or urn:harpora:federated. An app that needs a strong sign-in for an action can check it, and send prompt=login or max_age to ask for a fresh one.