Skip to content
Customer IdentityMarkdown

Protect customer sign-in

What protects a public customer sign-in today, how to tune lockout so it can't be turned against your customers, and what to add until bot protection arrives.

Available, with limitsDashboard and API

A customer sign-in is open to the whole internet, so it meets password guessing, credential stuffing and people trying to lock others out. Every realm protects it from the first day: lockout stops guessing, the sign-in never says which accounts exist, and passkeys leave nothing to guess or phish. Lockout locks the account, though, so on a public realm you tune it for customers rather than staff. Bot challenges and checks per address are planned.

  • Privilege: RealmOwner in the customer realm to change sign-in settings; RealmViewer is enough to read them and the audit trail. See Delegated administration.
  • Where: the dashboard (Authentication → Settings) or the API. Call the API shows how to get $CVYUH_SESSION.
ProtectionOn by defaultWhat it does
LockoutYesAfter repeated failures against one sign-in name, that account is refused for a while, even with the right answer
No account enumerationYesA name the realm doesn’t hold is answered and counted exactly as a real one, so no page reveals who has an account
PasskeysYesNothing to guess and nothing a fake site can capture
A second stepYesA password sign-in also asks for a code from an authenticator app
Bot challenges, checks per address, fake sign-up checksPlannedSee What’s next for customer sign-in
Breached-password checksPlannedSee What’s next for authentication

Lockout counts failures against the name typed, not against where they come from. That is what stops a guesser who targets one account, and it is also what lets anyone who knows a customer’s sign-in name lock that customer out: they type it with wrong answers until the account locks.

  • A lock stops every method. A locked account is refused with a passkey too, not only with a password.
  • A lock ends on its own. It lasts lockoutDurationMinutes, and an administrator can’t end it sooner today.
  • Failed passkey attempts count toward the lock, as wrong passwords and wrong codes do.

For staff, a long lock is a fair price. For customers, a lock is a customer who can’t buy from you, so keep each one short: a guesser still gets only a handful of tries per lock, and a customer who is locked out by someone else is back in minutes.

As a realm administrator, set lockout for a customer realm: more tries before a lock, a short window and a short lock.

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": 10, "lockoutWindowMinutes": 15, "lockoutDurationMinutes": 15 }'

The realm answers 200. Then:

  1. Move customers to passkeys. A customer who signs in with a passkey has no password to guess or reuse; see Passkey sign-in for customers.
  2. Keep the second step on (twoFactorMandatory: true, the default for a new realm), so a guessed or reused password alone signs no one in.
  3. Protect your own sign-up form. Accounts are made by your app’s back end today (see Create customer accounts), so put your own bot challenge and per-address limits on that form. That is where fake sign-ups are stopped until the realm does it.
  4. Watch for locks. A rise in ACCOUNT_LOCKED records across many customers is an attack, not mistyping; see Audit records.

Don’t turn lockout off (lockoutEnabled: false, or a threshold, window or duration of 0) on a public realm: that leaves guessing unbounded.

  • A wrong password, code or passkey is refused with the same message whether or not the account exists.
  • Close to a lock, from the lockoutWarnUser-th failure (off by default), the page says how many attempts are left: “3 attempts left before your account is locked.”
  • A locked account is refused, without the page saying why. The customer can try again once the lock has passed.
SettingDefaultRange
lockoutEnabledtrue
lockoutThreshold5 failures0 turns lockout off
lockoutWindowMinutes300Up to the deployment’s ceiling, a day unless changed; 0 turns lockout off
lockoutDurationMinutes30Up to the deployment’s ceiling, a day unless changed; 0 turns lockout off
lockoutWarnUser0 (off)Takes effect only below lockoutThreshold
twoFactorMandatorytrue in a new realm

A setting past the ceiling is refused with 400. Counting is per realm: a lock in one realm never reaches another.

SymptomCauseFix
A customer can’t sign in with the right password or passkeyTheir account is locked, by their own mistakes or by someone typing their nameRead their trail for ACCOUNT_LOCKED. The lock ends after lockoutDurationMinutes; ask them to try again then
Many customers locked at onceSomeone is typing many names with wrong answersShorten lockoutDurationMinutes so locks cost customers little, and move customers to passkeys
A customer locked again and againSomeone is aiming at that one accountShort locks keep them able to sign in between attempts. Change their sign-in name if they agree
Lockout seems never to triggerLockout is off, or the threshold, window or duration is 0Read authSettings and set all three above 0

Every sign-in and every lockout step is on the audit trail, under the customer’s id:

EventWhen
LOGIN_FAILEDA sign-in failed, with each step’s result and the address it came from
AUTH_FAILURE_RECORDEDA failure was counted toward a lock
ACCOUNT_LOCKEDThe account locked
LOCKOUT_CLEAREDA successful sign-in cleared the count
PATCHEDA change to authSettings, before and after, in Change history

Look into a locked account shows how to read them.

Bot challenges, checks that slow or block one address without locking the accounts it aims at, and fake sign-up checks are on What’s next for customer sign-in.