# Authentication

> How your users sign in, with passkeys, passwords and authenticator apps, in the order you choose, and the sessions, lockout and password rules that keep it safe.

Authentication is how a user proves to your realm who they are. Every new realm signs users in with a passkey alone, or
with a password followed by a code from an authenticator app, and it requires that second step from the first
minute. You can change which methods a realm offers and in what order, how long a session lasts, and how hard the
realm pushes back on guessing.

The one idea to hold: **a chain decides, a module checks.** Each sign-in method is a module that checks one thing,
such as a password or a passkey. A chain puts modules in order and says what each answer means for the sign-in.
A successful sign-in gives the user a session that records how they signed in, and every app and token the realm
issues reads from it.

<CardGrid>
  <LinkCard title="Sign-in methods" description="Passkeys, passwords, authenticator apps and recovery codes." href="./sign-in-methods/" />
  <LinkCard title="Sign-in chains" description="Put methods in order, and the chains every realm starts with." href="./sign-in-chains/" />
  <LinkCard title="Sessions" description="How long a sign-in lasts, how many one user holds, and how to strengthen it." href="./sessions/" />
  <LinkCard title="Lockout" description="Repeated wrong answers lock the account for a while." href="./lockout/" />
  <LinkCard title="Session management" description="Find a user's sessions and end them, one or all at once." href="./session-management/" />
  <LinkCard title="Password rules" description="A weak password is refused whenever it is set." href="./password-rules/" />
</CardGrid>

## Capabilities

### Prove who you are

| Capability | What it gives you |
|---|---|
| [Passkeys](./sign-in-methods/#passkeys) | Users sign in with a passkey alone, and add more once signed in (with limits) |
| [Passwords](./sign-in-methods/#passwords) | A username and password, checked against the realm's own users |
| [Authenticator app](./sign-in-methods/#authenticator-app) | A six-digit code from an app on the user's phone, as a second step every user sets up, with a skip you can allow for a set time |
| [Recovery codes](./sign-in-methods/#recovery-codes) | One-time codes that replace a lost authenticator app |
| [Confirm identity](./sign-in-methods/#confirm-identity) | Before a sensitive change, the user shows they still hold their app or a passkey |
| [Password rules](./password-rules/) | A weak password is refused whenever it is set |
| [Users' own factors](./sign-in-methods/#users-own-factors) | Users list their passkeys and apps, and remove one themselves |
| [Pages in the user's language](./languages/) | Sign-in prompts in English, French or German, with your own wording |

### Shape the sign-in

| Capability | What it gives you |
|---|---|
| [Sign-in chains](./sign-in-chains/) | Methods in order, each with what its answer means |
| [Sign-in modules](./sign-in-modules/) | Every module's name and settings, with their defaults |
| [Branching](./sign-in-chains/#branching-with-routes) | An answer that skips ahead, such as straight to a password for a user with no passkey |
| [Chains every realm starts with](./sign-in-chains/#the-chains-a-realm-starts-with) | A safe sign-in from a realm's first minute |
| [An administrators' chain](./sign-in-chains/#set-it-up) | A separate sign-in for the realm's administrators |
| [Safe return addresses](./sign-in-chains/#good-to-know) | After sign-in, a user is sent only to addresses you allow |

### Keep sessions safe

| Capability | What it gives you |
|---|---|
| [Sessions](./sessions/) | How long a sign-in lasts, how long it may sit idle, and how many sessions one user holds; the oldest end first |
| [Stronger sign-in in place](./sessions/#making-a-session-stronger) | A stronger chain before a sensitive action upgrades the same session |
| [Lockout](./lockout/) | Repeated wrong answers lock the account for a while, even against the right password |
| [Session management](./session-management/) | Find a realm's sessions and end them, each as a sign-out |
| [Who am I](./sign-in-methods/#who-am-i) | One call returns the signed-in user, their profile, roles and session |

## Coming next

- [Sign-in by email code](./whats-next/#sign-in-by-email-code): a one-time code or link, with no password.
- [Passkey autofill](./whats-next/#passkey-autofill): the username field offers the user's passkeys as they type.
- [Password reset](./whats-next/#password-reset): users reset a forgotten password themselves.
- [More password rules](./whats-next/#password-reuse-expiry-and-breached-passwords): no reused or breached
  passwords, and passwords that expire.
- [External directories](./whats-next/#external-directories): users sign in with an account held in another
  directory.

Everything else on the way is on [What's next for authentication](./whats-next/).

## Guides

- [Step up for sensitive actions](../guides/stronger-sign-in/step-up-for-sensitive-actions/)
- [Ask users to sign in again](../guides/stronger-sign-in/ask-to-sign-in-again/)
- [Sign users in to a web app](../guides/sign-in-to-apps/sign-in-web-app/)
- [Sign users in to your own native app](../guides/sign-in-to-apps/native-app-sign-in/)
- [Keep apps signed in](../guides/sessions/keep-apps-signed-in/)
- [Cut a user off now](../guides/sessions/cut-a-user-off-now/)
