# Passwords

Passwords follow NIST SP 800-63B: length matters, composition rules do not.

## Rules

| Setting                   | Default | Range                  |
| ------------------------- | ------- | ---------------------- |
| `password_min_length`     | 10      | 8 to 64 characters     |
| `password_history`        | 5       | 0 to 24 past passwords |
| `password_check_breached` | on      | on or off              |

Set them with `PUT /v1/user_management/settings`. Any printable Unicode and spaces are accepted, up to 256 bytes, normalized before hashing. A password that contains the email's local part or the app name is refused.

## Breached-password check

New passwords are checked against the Have I Been Pwned range API with k-anonymity: only the first five characters of the password's SHA-1 hash leave OhAuthCat, with response padding on. If that service cannot be reached, the password is accepted and the audit log records `password.breach_check_unavailable`; the check guards password quality, not sign-in.

## Storage and throttling

Passwords are hashed with Argon2id and a server-side pepper. After 10 failures in 15 minutes for one address, further attempts are throttled; a throttled answer looks the same as a wrong password, so an attacker cannot lock a user out.

## Reset

A reset link is single-use, valid for 30 minutes, bound to the browser that asked for it, and invalidated by any password change. Your server can also set or remove a password with `PUT` or `DELETE /v1/users/{user}/password`.

## Errors

[`password_too_short`](/errors/password_too_short/), [`password_too_long`](/errors/password_too_long/), [`password_invalid`](/errors/password_invalid/), [`password_contains_account_details`](/errors/password_contains_account_details/), [`password_breached`](/errors/password_breached/), [`password_reused`](/errors/password_reused/) and [`user_credentials_invalid`](/errors/user_credentials_invalid/).
