Skip to content

Authentication

Users, sign-in methods and passwords in each realm.

Each realm with an auth section has its own pool of users and API keys, stored in the realm’s system database. One sign-in is meant to work across all databases of that realm (single sign-on), and never in another realm.

Strategies

A realm says how people sign in with named strategies in auth.strategies. A strategy is an ordered list of methods: the first proves who the person is, and a later one (totp) adds a step.

auth:
  strategies:
    password: [password]               # email and password
    password_totp: [password, totp]    # and then an authenticator code
    google: [google]                   # a provider declared in auth.providers
  • The methods are password, magic_link, totp (never first), sso (an organization’s own connection; needs organizations.sso) and the names of the providers in auth.providers.
  • Choosing one. The sign-in routes take a strategy (POST /_auth/login, POST /_auth/magic-link, the provider routes, and the same under /_auth/orgs/{org}/…). It may be left out while exactly one strategy starts with that method; otherwise the answer is 400 strategy_required. A name that does not exist or starts with another method is 400 unknown_strategy. GET /_auth/strategies (no credentials) lists the names and their methods, so an app can draw its sign-in screen.
  • Steps. Every method must succeed, in order. After the first, a totp step answers with a challenge (next: ["totp"]) that POST /_auth/mfa/verify trades for the next step or the session; a person with no authenticator enrols as part of signing in (Multi-factor authentication). A person’s own authenticator never adds a step to a strategy that lacks totp.
  • Roles. A role can list the strategies it accepts (roles.<name>.strategies; none listed means all). A role is active in a session only if the session’s strategy is one of them: user.roles in rules and functions, the admin API and the admin interface see the active roles only. A person who signs in with a strategy their role does not list still gets a session, without that role, and the answer’s roles_inactive says which roles stayed off, so the app can offer a stronger way in. Listing is explicit: a stronger strategy does not carry a weaker one’s roles unless the role lists it.
  • The session records its strategy, its methods and mfa.
  • auth: disabled runs a realm without authentication; a realm with neither is refused at startup. The keys that used to sit at the top of realm.yaml (signup, sessions, password, login_throttle, providers, sign_in, magic_link, reauth) now sit under auth:, and mfa is auth.totp; the old keys fail to start with a message that names the new place.

Sign-in methods: providers

A user holds only identity data: a unique email, whether that email is verified, roles, and whether the account is disabled. Credentials are not part of the user. Each way of signing in is a provider — a sign-in method (an identity) linked to the user:

  • password — built in, nothing to declare; the realm’s own accounts.
  • magic_link — an emailed link or code, from the realm’s auth.magic_link section (Magic links). It proves control of the mailbox, the same thing a password reset proves.
  • google, microsoft, apple — remote providers, declared in the realm’s auth.providers section with their credentials as realm secrets (Sign in with…). password and email are reserved names: no provider may take them.

A user can have several methods at once, at most one of each kind — a password and Google, say. They all lead to the same user, so roles, rules and owned documents don’t depend on how the user signed in. A user can exist without a password (an operator may create the account first), and can remove any method but the last (DELETE /_auth/identities/{provider}); GET /_auth/me lists them. Application data about a user, such as a display name or avatar, belongs in your own collections, not in the user.

Whatever the first factor, a user with a second factor is still asked for it — a provider sign-in answers the same challenge a password does: Multi-factor authentication.

The pages, in order

PageWhat it covers
Authentication strategiesHow a realm lets people sign in: strategies, their steps, and roles that depend on them
Users and passwordsCreating and managing a realm’s users with backd user or the admin API
Sign-up, login and sessionsThe /_auth endpoints: sign up, log in, sessions, password reset, brute-force protection, sign-in methods, deleting the account
Magic linksSigning in from an email alone: the link, the code, account claiming
PasskeysSigning in with a fingerprint, face, PIN or security key: how they work, rp_id and origins, native apps, a lost device
Re-authenticationA fresh proof of identity before sensitive actions
Multi-factor authenticationThe TOTP second factor, recovery codes, roles that need it — applies to every first factor, remote providers included
Sign in with Google, Microsoft or AppleThe redirect flow, native ID tokens, linking rules, account.on_signup
Access rulesPer-collection rules: in collection.yaml: which callers may read, create, update and delete
ConsentsVersioned texts, records, re-acceptance, withdrawal, gating
API keysServer-side services, with full access to the realm’s data

Operating it

See the security model for what backd protects, and the hardening checklist before exposing a realm. Planned: personal-data export as a downloadable package; other OpenID Connect providers (type: oidc).

Authentication strategies

How a realm decides who may sign in and with what: strategies in plain words, the common setups, and roles that depend on how a person signed in.

Passkeys

Sign in with a fingerprint, a face, a PIN or a security key instead of a password: how passkeys work in plain words, how to turn them on, and what to keep for the day a device is lost.

Users and passwords

Create and manage a realm’s users with backd user or the admin API.

Sign-up, login and sessions

The /_auth endpoints: sign up, log in, manage sessions, change or delete the account.

Magic links

Sign in from an email: a link on the same device, or a code typed on any device. How it works, who can use it and what it protects against.

Re-authentication

A fresh proof of identity before sensitive actions: which proof applies to which user, the endpoints that ask for it and how a client sends it.

Multi-factor authentication

A second step after the first factor: how a sign-in answers with a challenge, how the second factor is checked, and how rules and functions see how a session was made.

Sign in with Google, Microsoft or Apple

Let users sign in with an external identity provider: configuration, the redirect flow, linking rules, errors and security.

Access rules (rules:)

Decide per collection which callers may read, create, update and delete documents.

Consents

Versioned consent texts kept with the config, accepted and recorded as proof, and served to apps.

Personal data export

Let a user download everything the realm holds about them, and let support produce the same for a formal request.

API keys

Give server-side services access to a realm’s data with API keys.

Edit this page · Last updated 13 Nov 2026