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
- Rules: 12 to 256 characters, any characters, no composition rules (NIST SP 800-63B). A password can't be the username or one character repeated, or one that has appeared in a data breach. That check asks Have I Been Pwned's range API (or
--breached-passwords URL), and only the first five hex digits of the password's SHA-1 ever leave Nod. If the list can't be reached, the password is allowed and the failure logged.--breached-passwords offturns it off. - Breached since: a password that signs someone in is checked against the same list, in the background (it can have leaked after it was set). If it's there, the sign-in still goes on, the security log says
password.breached, and the person is asked by email (verified addresses only) to choose a new one: once per password. - Longer passwords:
nod realm set acme --password-min-length 16(or"password_min_length": 16) raises the minimum, from 12 up to 64 characters; it can't go below 12. - History:
nod realm set acme --password-history 5(or"password_history": 5) refuses a new password that is one of the last five (the current one counting), whoever sets it: the person, a reset, an administrator. Only as many earlier hashes are kept as the setting needs; 0 (the default) keeps none. - Lockout: ten wrong passwords in a row lock password sign-in for 15 minutes. A correct one resets the count. When a lockout starts, the person is told at their verified address (once per lockout; passkeys still work), and the security log says
signin.locked. Whoever is guessing sees the same answer throughout. - Every failure looks the same, in message and in time, whether the username exists or not.
- Forgotten passwords: "Forgot your password?" on the sign-in page takes a username or a verified email address. The answer is the same whether or not it matched anything. A reset link goes only to a verified address, works once, and lasts 30 minutes. Using it signs the account out everywhere.
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"):
- With an authenticator app set up: its code, as always.
- Without one: the person sets one up while signing in: the page shows the app's key (and an
otpauth://link for a phone), takes its first code, then shows ten recovery codes once. The session'sacrisurn:harpora:password-otp. - A password alone can't set up an app for someone else: a person with a verified address proves it first, with the code emailed to them, before the key is shown. Someone with no verified address can only be trusted with the password, as with any service that sets up a second factor at sign-in; give your people verified addresses (or passkeys) before turning this on.
- Passkeys are multi-factor already (something you have, unlocked by something you know or are): unchanged. Outside providers keep their own second factor: Nod doesn't add one after them.
- For another frontend: after
password/sign-in(orpassword/email-code),{"mfa_enroll": "totp", "uri", "secret"}means show the key, thenPOST password/totp-enroll {"code"}, which answerssigned_inwithrecovery_codes.
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.
- A device is a browser holding Nod's device cookie (256 random bits, a year, HttpOnly), given at the end of any sign-in and stored only as its hash. Each person keeps their twenty most recent. A new browser, or cleared cookies, is a new device, and a made-up cookie is too.
- Who it asks: people signing in with a password (or an LDAP directory password). People with an authenticator app are asked for it every time anyway. Passkeys are already bound to the device and phishing-resistant, so they never are. Someone without a verified address can't be sent a code, and signs in as before.
- What the app sees:
acrurn:harpora:password-email. Each new-device challenge is in the security log assignin.new_device. - For another frontend: after
password/sign-in,{"mfa_required": "email"}meansPOST password/email-codewith{"code"}, as"totp"meanspassword/totp.
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.
- A code works for ten minutes, once, and only for the address it was sent to, while that address is still the account's verified one. Five wrong tries end it. A new code replaces the last.
- With an authenticator app set up, the code is the first step, and the app's code (or a recovery code) the second, as after a password. The session's
acrisurn:harpora:email, orurn:harpora:email-otpwith the second step. - Guarded like a password: requests count against the per-account and per-address limits, a wrong code is a failed sign-in (suspicious-IP throttling counts it), and with bot detection on, asking for a code needs a solved challenge (each request sends an email).
- The email has a link too. It opens a page with a "Sign in" button: opening the link, as mail scanners and previews do, signs nobody in. The link works only in the browser that asked for the code (a binding cookie set then, for ten minutes, on the email paths), once. Opened in another browser, it's refused but not used up, so it still works where it belongs. After it, the person goes on to the app they were signing in to.
- For another frontend:
POST email/startwith{"email", "request"}(the authorization request, so a link can resume it), thenPOST email/finishwith{"email", "code"}. The link's page is Nod's own (GET email/link?token=…, thenPOST email/linkwith{"token"}; theNod-Nextheader says where to go). The answer issigned_in, ormfa_requiredand thenPOST password/totpas after a password.
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}
- Countries: texts go only to numbers starting with one of the realm's calling codes (
+61;+1212narrows+1to one area code). None are allowed until you set some, so nothing is sent anywhere you didn't choose. Toll fraud (SMS pumping) sends codes to premium numbers in countries you have no customers in: list only the countries your people are in.+1covers the US, Canada and the Caribbean's NANP countries alike. - Numbers: a person adds one on their account page, in international form (
+61 412 345 678; kept as E.164). It is pending until the code texted to it comes back; their old number (if any) stays theirs until then. Then the old number gets a text saying it no longer gets codes, and their verified email is told too. Removing it tells both the same way. A number belongs to one account in a realm. - Codes: six digits, five minutes, once; five wrong tries end a code. They are stored only as a hash bound to the realm, the person, the number and the purpose (verifying a number, a second step, a sign-in), so one never passes for another. A number replaced or removed since makes its codes worthless.
- Limits: five texts an hour and ten a day to a number; the realm's daily cap across all numbers; ten wrong codes an hour per number and per person (past that, even the right code isn't checked until the hour is out); twenty checks per address per quarter hour, and the usual suspicious-IP throttling. Asking for a sign-in code needs a solved challenge with bot detection on. All but the last two are counted in the store, so every replica counts the same.
- The text is short, names the realm, and ends with the domain-bound line phones read to offer the code only on your sign-in page (
@auth.example.com #123456, for Apple's and Google's autofill and WebOTP). - As a second factor (
sms_mfa): a person with a verified number is asked for a texted code after their password (or an emailed sign-in code), every time, as with an authenticator app. With an app as well, the app is asked for and a text offered instead ("Text me a code instead").acrisurn:nod:password-sms(orurn:nod:email-sms). It meetsrequire_mfa, except for administrators (below). - As a sign-in method (
sms_sign_in): "Text me a sign-in code" takes a number and texts a code if it is an account's verified number; the page says the same whatever number is typed. The code signs them in (urn:nod:sms), or leads on to their authenticator app (urn:nod:sms-otp). A texted code is never the second step after a texted code. - Administrators: SMS is never the only factor for anyone with permissions on the realm's management API. Their SMS sign-in goes on to their authenticator app, and without one nothing is sent and a code is refused; and SMS never meets
require_mfafor them (they set up an app while signing in). - What administrators see: in the management API's users,
phone_numbermasked (+61*******78) andphone_number_verified; never the whole number. The person's data export has it whole. - Logs: the security log has
sms.sent,sms.verified,sms.removed,sms.failed(a wrong code, a country not allowed, the provider refusing) andsms.rate_limited, the number masked, never a code. A provider's error is reduced to its HTTP status: its body (which may echo the request, credentials and all) is never kept. - For another frontend: after
password/sign-in,{"mfa_required": "sms"}(or"totp"with"sms": true) meansPOST password/sms/send, thenPOST password/smswith{"code"}. Signing in by number:POST sms/startwith{"phone"}, thenPOST sms/finishwith{"phone", "code"}. The account page:POST account/phonewith{"phone"},account/phone/verifywith{"code"},account/phone/remove.GET ui/configsayssms_codes.
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
- At the provider, register the redirect URI
<issuer>/federation/callback(for examplehttps://auth.example.com/acme/federation/callback). - On the sign-in page, a button appears per enabled connection. People who come through one become users of the realm, linked by the provider's issuer and their subject there. They are the same user every time.
- Linking is done by the person, not by email. On the account page, "Link Google" sends them to the provider and back. The outside account is then theirs, and signing in through it signs them in. Nod never joins accounts because their email addresses match. An outside account that already belongs to another user stays theirs: linking it is refused, never moved. Finishing a link needs the same person still signed in, and a recent sign-in, like every account change. "Unlink" removes it, unless it is their only way to sign in.
- Their email comes too (ask the provider for the
emailscope), so apps that ask Nod foremailget it. It is verified only when an OpenID Connect provider saysemail_verifiedand the address is in one of the connection's verified domains (--verified-domain, repeatable;verified_domainsin the management API and configuration files): the email domains you vouch for this provider on, such as your Google Workspace's own. Any provider can say anything about any address, so without the list a connection verifies nothing. A domain matches exactly (acme.exampledoesn't covereu.acme.example; list both). Any other address is kept, unverified, and isn't one that emailed codes or password resets find. GitHub's, plain OAuth 2.0's and SAML's addresses are always unverified. A provider's address fills in an empty or unverified one, never one the person verified, and an address another user of the realm has verified is never verified for a second person. It is still never used to join accounts. - **
nod connection verified-domains acme google --domain acme.example** (orPATCH /connections/{id}with"verified_domains") replaces an OpenID Connect connection's list in place; with no--domain([]) it verifies no address. Addresses already verified stay verified. - OpenID Connect providers cover Google, Microsoft, Okta, Auth0, Keycloak and any other Nod. Apple is its own kind (below). GitHub, any plain OAuth 2.0 provider and LDAP / Active Directory work too (see below). SAML is planned.
- **
nod connection scopes acme google --scope email --scope profile** (orPATCH /connections/{id}with"scopes") changes what a connection asks the provider for, in place: people keep their links. An OpenID Connect connection always asks foropenid; LDAP and SAML connections have no scopes. - **
nod connection disable acme google** hides a connection and refuses sign-ins already under way through it.
Straight to a provider
Two ways to skip the sign-in page and its button:
- Per request:
/authorize?…&connection=google(Auth0'sconnection, Keycloak'skc_idp_hint) goes straight to that connection when the realm, and the organization if one is named, offers it; otherwise the page shows as usual. - For a realm:
nod realm set acme --sign-in-connection google(orsign_in_connectionin the management API and configuration files) sends every sign-in there, for a realm whose people all use one provider. A request's ownconnectioncomes first;--sign-in-connection ""brings the page back.
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
- At Apple (Certificates, Identifiers & Profiles): a Services ID (that's
--client-id) with Sign in with Apple turned on, its domain, and the return URL<issuer>/federation/callback; a key with Sign in with Apple, downloaded once asAuthKey_<key id>.p8; and your team id (top right of the developer site). - **The
.p8is the secret:** read from stdin, sealed at rest like any connection's secret, and never shown again. For every sign-in, Nod signs a client secret that lives five minutes (issyour team,subthe Services ID,audhttps://appleid.apple.com,kidthe key's id). Nothing needs rotating every six months; to change keys, add the connection again with the new one. - The code comes back posted (
response_mode=form_post, which Apple requires to share a name or address). That post is cross-site and carries none of Nod's cookies, so Nod posts it again from its own origin (as it does SAML's) and only then checks the flow's browser binding. - Who signed in comes only from the ID token Nod fetches and checks (Apple's issuer and keys, our Services ID, the nonce). The
userfield Apple adds to the first post (the person's name) is never read: the browser could change it. People can fill their name in themselves. - Addresses: Apple's
email_verifiedcounts only in a domain you vouch for (--verified-domain), as with any OpenID Connect provider; private relay addresses (@privaterelay.appleid.com) stay unverified unless you vouch for that domain. - Scopes default to
openid email name. In the management API:"kind": "apple","apple_team_id","apple_key_id", and the.p8as"client_secret".
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
- At GitHub, create an OAuth app (or a GitHub App with user authorization), with the callback URL
<issuer>/federation/callback. - Who the person is comes from GitHub's API (
/user), asked with the token Nod got by exchanging the code itself, never from anything the browser carries. - The link is GitHub's numeric user id, not the login. People rename their logins, and someone else can then take the old one. A renamed account stays the same user, and whoever takes a freed login is a new one.
- The username starts as their login (made unique in the realm), and the display name and picture come from their profile. The default scope is
read:user.
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
- **The link is the id at
--id-pointer** (a JSON pointer,/idby default). It must be a non-empty string or a positive whole number, the provider's stable id for the person, never a name they can change. Accounts are keyed by--issuerand that id.--username-pointer(/username) and--name-pointer(/name) only suggest the new user's names. - Who signed in comes from the userinfo endpoint, asked with the token Nod got by exchanging the code itself (with PKCE), never from anything the browser carries. The token answer must be a bearer token, and an
errorin it is a refusal, even with HTTP 200. - The client authenticates with HTTP Basic, or in the form with
--token-auth postfor providers that want that, never both. - Every endpoint must be https to a public address, unless the connection is for development.
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"
- Domains decide. Whoever signs in as
someone@corp.exampleis checked against this directory, and never against a local password, even if a local account has that name. Each domain has one directory. - Finding the person: Nod binds as the service account (leave out
--bind-dnand send an empty line to search anonymously). It then searches--base-dnwith the filter (default(|(mail={username})(userPrincipalName={username}));{local}is the part before the@, so(uid={local})or(sAMAccountName={local})work too). Exactly one entry must match. Nod then binds as that entry with the password given: a correct bind signs the person in. - **The link is the entry's
entryUUID** (Active Directory'sobjectGUID), not its DN. Someone renamed or moved in the directory keeps their account. Accounts belong to the connection: another connection, even to the same directory, has its own. - Refused, after other products' advisories: an empty password (many directories, Active Directory among them, treat it as an unauthenticated bind and say yes); a username used as a filter (
*, parentheses and backslashes are escaped, RFC 4515); two entries for one address; referrals, which are not followed. - TLS only:
ldaps://, trusting--cawhen the directory's certificate comes from a private CA, otherwise the system's roots. Private addresses are fine, since directories usually live on the company's network. Loopback and link-local addresses are refused, andldap://is for development (--insecure-dev). - The sign-in page asks for a password whenever a directory serves the realm, even with local passwords off. Wrong passwords count toward the same per-account and per-address limits as local ones, and the directory's own lockout policy applies too. The security log says
password (LDAP corp). - A customer's directory, their organization: an organization that lists the connection with
join_on_sign_intakes in its people the first time they sign in, as it does for its OpenID Connect provider. With LDAP no authorization request names an organization, so every organization that lists the connection that way does so. - Not yet: changing or resetting a directory password from Nod (that's the directory's job) and syncing groups.
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).
- Sign-in starts at Nod (the "Continue with Corp" button): an
AuthnRequestby HTTP-Redirect, and the response comes back to the callback by HTTP-POST. Responses nobody asked for (IdP-initiated sign-in) are refused: they bind to no request, which is where login CSRF and response injection live. - Only the IdP's certificate checks a response; certificates inside the message are ignored. The assertion must be covered by a signature (its own, or the response's around it). SHA-1 is refused: Nod is built without it.
- Only what was signed is read. Nod reads the assertion the signature covers, never the first one it finds, so a forged assertion beside, around or instead of the signed one (signature wrapping) changes nothing. A response with two assertions, an encrypted one, duplicate IDs or a DTD is refused.
- For this sign-in, here, now: the
Issueris the IdP's, theAudienceand the bearerRecipientare Nod's,InResponseTois this browser's request, and the times are in range (two minutes' skew). Each request takes one response: a replay, even into a new sign-in, is refused. - **The person is the
NameID**, read whole (a comment can't cut it short, CVE-2017-11427), and linked by (IdP, NameID), never by email. Set the IdP to send a persistent or email NameID: a transient one changes at every sign-in and is refused. Anemailattribute (or the NameID's local part) suggests the username. - Same browser: the IdP's POST is cross-site, so it carries none of Nod's cookies. Nod posts it again from its own page, and acts only on that same-origin post, which carries the cookie that binds the sign-in to the browser that started it.
- Organizations, linking and the account page work as for OpenID Connect providers.
- Encrypted assertions: the metadata carries Nod's key (one per realm, made when the metadata is first fetched, sealed at rest), with the algorithms Nod accepts. An IdP may encrypt with AES-GCM; AES-CBC only when it also signs the whole response (checked before anything is decrypted, so a changed ciphertext is never opened); the key always by RSA-OAEP, never
rsa-1_5. Every decryption failure gets one answer.--require-encryption(orsaml_require_encryption: truein the config file) refuses plain assertions from that IdP. - Signed requests:
--sign-requests(orsaml_sign_requests: true) signs eachAuthnRequestwith Nod's key for the realm (HTTP-Redirect binding, RSA-SHA256), for an IdP that requires it; the metadata carries the same certificate as the signing key. - Rotating Nod's key:
nod saml rotate-key acmemakes a new key, which signs requests at once and is offered first for encryption. The previous key keeps decrypting, and stays in the metadata for encryption, until the next rotation drops it: give IdPs that pinned the old certificate the new one before rotating again. - Single logout from the IdP: give the connection the IdP's logout URL (
--slo-url); the metadata names Nod's ($ISSUER/federation/saml-logout, HTTP-Redirect). ALogoutRequestsigned by that IdP ends the sessions that signed in through it as that NameID (only those of its SessionIndex, when it names one), never a session made another way; the apps that signed in through them hear it by back-channel logout; and the IdP gets aLogoutResponse, signed when the connection signs its requests, with its RelayState back. Unsigned, forged or misdirected requests end nothing. - Signing out of Nod signs out of the IdP too (for a connection with
--slo-url): Nod ends its session at once, then sends the browser to the IdP with aLogoutRequestsigned by the realm's key (its NameID and that sign-in's SessionIndex), and the IdP's answer, back at$ISSUER/federation/saml-logout, sends the person on to where the app asked (once, within ten minutes). The answer grants nothing, so it needn't be signed: only the IdP holds the request's id it must name. - Nod as the IdP: for apps that sign in with SAML, see Apps that sign in with SAML.
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
- Only plain values are accepted, because they go into the page: colours as
#rrggbb, the logo and links as https URLs without credentials or quoting characters, and the heading as up to 80 characters of text (shown escaped). - The page's security policy stays strict. Images may come from the logo's own origin and nowhere else new; scripts and styles still need the page's nonce, and the page still can't be framed.
- The same values come back from
GET /{realm}/ui/config(see Frontends), for a frontend of your own.
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"}}'
- The keys are a fixed catalogue (
GET $ISSUER/api/v1/realm/text/delists each with its English default);{app},{provider},{organization},{email},{scope},{binding},{username},{date}and{count}are filled in by the page. Keys you leave out show the default. - Which language: the first one the realm has written, from the app's
ui_locales, then the browser'sAccept-Language(de-ATfindsde). One it hasn't written shows English: Nod ships no translations of its own. - Plain text only, one line, up to 200 characters, shown as text and never as HTML. Up to 20 languages a realm.
realm:adminsets and deletes;realm:readreads.
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.
- **
always:** every one of those requests needs an easy challenge (2^12 hashes). - **
risky:** only requests from an address that has used half its allowance of failed sign-ins (suspicious-IP throttling then stops it outright at the full allowance) need one, and a harder one (2^17 hashes, a second or two).alwaysasks for the harder one from such an address too. - Each challenge is signed by Nod (with a key derived from
NOD_SECRET_KEY, so any replica checks it), for one realm and one kind of request, good for five minutes, and used once.
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.