Skip to content
Workforce IdentityMarkdown

Lockout

After repeated wrong passwords or codes, the realm locks the account for a while, even against the right answer, without revealing which accounts exist.

AvailableDashboard and API

Lockout protects every sign-in. After repeated wrong passwords or codes, the account is locked for a while, even against the right answer. It’s on in every new realm, and you choose how many failures lock an account, over what window, and for how long.

  • Who can do it: a realm administrator, in a group that holds RealmOwner in this realm or one above it (Delegated administration). RealmViewer can read the settings but not change them.
  • Where: in the dashboard, Authentication → Settings; or through the API (Call the API shows how to get $CVYUH_SESSION).
  • First: nothing. Lockout is on with the defaults below.

Lockout counts a realm’s failed sign-ins against a username.

  • A wrong password counts, and so do a wrong code from an authenticator app the user has set up and a passkey that doesn’t verify. A mistyped code while setting up a new app doesn’t.
  • Names the realm doesn’t hold are counted the same way, so lockout never reveals which accounts exist.
  • At lockoutThreshold failures within lockoutWindowMinutes, the account is locked for lockoutDurationMinutes. The lock then lifts on its own.
  • A locked account is refused even with the right password, code or passkey.
  • From the lockoutWarnUser-th failure, the realm tells the user how many attempts are left.
  • A successful sign-in clears the count, once the whole chain has succeeded.

Lockout is separate from an authenticator app’s or a passkey’s own failure count, which disables that one factor (see Sign-in methods).

In the dashboard, open Authentication → Settings and change the lockout fields. Or change them through the API:

Terminal window
curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/authSettings/authSettings \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
-H "Content-Type: application/json" \
-d '{ "lockoutThreshold": 5, "lockoutWindowMinutes": 60, "lockoutDurationMinutes": 30, "lockoutWarnUser": 3 }'
WhenThe sign-in page says
A wrong password or code, before the warning pointThe usual refusal, and the page asks again
A wrong answer from the lockoutWarnUser-th failure on”Invalid credentials. You have 2 attempts remaining before your account is locked.”
The failure that locks the account”too many failed attempts”
Any sign-in while the account is locked”account locked”, whatever was entered

Each of these answers 401. A name the realm doesn’t hold is warned and locked the same way, so none of these messages confirms that an account exists. The messages are in English only today.

What a locked user should do: wait for the lock to lift (30 minutes by default), then sign in with the right password. Signing in successfully clears the count.

Setting or limitDefaultRange
lockoutEnabledtruetrue or false
lockoutThreshold: failures that lock50 turns lockout off
lockoutWindowMinutes: how far back failures count300up to a day (1440); 0 turns lockout off
lockoutDurationMinutes: how long a lock lasts30up to a day (1440); 0 turns lockout off
lockoutWarnUser: the failure that first warns0 (off)below lockoutThreshold; at or above it, never warns
SymptomCauseFix
A user is locked out and hasn’t typed a wrong passwordSomeone else typed wrong passwords against their username: lockout counts by nameWait for the lock to lift; look at the AUTH_FAILURE_RECORDED records for where the attempts came from. For users who are often targeted, see Good to know
A save is refusedThe window or duration is longer than a dayChoose a day or less
Users are never warnedlockoutWarnUser is 0, or at or above lockoutThresholdSet it below the threshold
An authenticator app stopped working, but the account isn’t lockedThe app reached its own failure cap and was disabledSee Sign-in methods

Every step is on the realm’s audit trail, under the name that was typed. In the dashboard, open Audit → Authentication; through the API, read the user’s trail (Read a user’s or agent’s trail).

EventWhenContext
AUTH_FAILURE_RECORDEDA failure was countedfailCount, threshold, whether the user was warned
ACCOUNT_LOCKEDThe failure that locked the accountfailCount, threshold, durationSecs
LOCKOUT_CLEAREDA successful sign-in cleared the count

Look into a locked account walks through reading them.

  • There’s no administrator unlock. A lock lifts when its duration ends. Keep lockoutDurationMinutes short enough that a user locked out by someone else isn’t kept out for long.
  • Counting by name is a trade-off. Anyone who knows a username can lock that account by guessing. The lock is short and never reveals whether the account exists. For users who are often targeted, such as administrators, passkeys take the password out of reach of guessing (Sign-in methods). On a public customer realm, see Protect customer sign-in.
  • A threshold, window or duration of 0 turns lockout off. There is no lock that waits for an administrator to clear it.
  • Lockout has ceilings. A window or lock longer than a day is refused, and a lock in one realm never reaches another.
  • Warning is a trade-off too. It helps someone who mistyped, and tells someone guessing how many tries are left.