Skip to content

Second factors and password policy

A password alone is a weak credential, so FlowCatalyst adds three things around it: a second factor for people who sign in with a password, a password policy that refuses guessable passwords, and backoff that makes guessing slow. All of it applies to platform users whose email domain signs in with platform credentials. People whose domain is federated to their organisation’s identity provider never have a platform password, so none of this applies to them: their organisation’s own MFA and lockout do (Sign-in and federation).

An internal user has two complete ways to sign in:

Way What it proves Second factor
Passkey (WebAuthn) Possession of a private key that never leaves the person’s device or password manager None. A passkey is not a shared secret that can be phished or guessed
Password, then a second factor when one is owed Something known, then something held TOTP authenticator app, an email PIN, or a recovery code

There is no SMS factor.

  • Authenticator app (TOTP). The user scans a QR code into an app such as an authenticator on their phone. The shared secret is stored encrypted with the platform’s application key (FLOWCATALYST_APP_KEY).
  • Email PIN. A six-digit code sent to the user’s address. It lasts 10 minutes, dies after five wrong guesses, and at most one sign-in code is sent per minute, so the challenge cannot be used to flood an inbox.
  • Recovery codes. Ten single-use codes, shown once when an authenticator app is set up, stored only as hashes and regenerable. They back the authenticator app only; email is its own recovery channel.
  • Remember this device. When the domain allows it, a user can skip the challenge on a browser for a number of days (30 by default). The browser holds a hardened cookie (__Host- prefix in production, HttpOnly, Secure, SameSite Strict). Every remembered device is revoked when the password changes or the user’s second factors are reset.

The policy lives on the email-domain mapping, so it is set per organisation: require2fa, the allowed methods (TOTP, EMAIL_PIN, at least one when required), and the remember-device switch and duration. After a password verifies, the platform decides:

flowchart TD
  P[Password verified] --> U{User has a usable factor?}
  U -->|yes| R{Remembered browser, and the domain allows it?}
  R -->|yes| S[Session]
  R -->|no| C[Challenge: TOTP, email PIN or recovery code] --> S
  U -->|no| D{Domain requires 2FA?}
  D -->|no| S
  D -->|yes| E[Enrol a factor now, then session]

A usable factor is one the user has confirmed and, when the domain requires 2FA, one of the methods the domain allows. A factor the domain no longer allows is dead. A user who set up a factor voluntarily is challenged even if their domain does not require it. When a domain switches 2FA on, its existing users are made to enrol at their next password sign-in: the password verifies, but no session is issued until a factor is set up. A user on a domain that requires 2FA cannot remove their last usable factor.

Wrong codes count as failed sign-ins and feed the same backoff as wrong passwords; while the backoff holds, no code is checked at all. The short-lived tokens between the steps (10 minutes for a pending challenge, 30 for an enrolment) are not sessions. If the platform cannot decide whether a factor is owed, it refuses the sign-in rather than skip the check.

Why a passkey does not exempt the password path

Section titled “Why a passkey does not exempt the password path”

A user who has registered a passkey may still choose to sign in with their password. When they do, they must pass the second factor exactly as anyone else would. The passkey plays no part in that decision.

The reason is that the password path is what an attacker uses. A stolen password is just as dangerous for a user who also owns a passkey, and if owning a passkey switched the second factor off, registering one would weaken the account instead of strengthening it. Only the passkey sign-in itself skips the challenge.

Self-service reset sends a link (valid for 15 minutes, single use) to the user’s address. What happens when they open it depends on the factors they have:

  • A user with a strong factor, an authenticator app (TOTP) or a passkey, must confirm the link with it: a current TOTP code, or a passkey check (the reset page offers it through POST /auth/password-reset/passkey/begin, and the confirm call takes the passkey credential). The link alone is not enough, so a compromised inbox cannot reset the password. An email PIN is never accepted here, because the PIN and the link would arrive in the same inbox. After a few wrong codes the link is burnt and a new one is needed.
  • A user without a strong factor, including one whose only second factor is the email PIN, gets the plain emailed link, and the link alone authorises the reset.
  • A user whose domain requires 2FA but who has no factor is made to enrol one when they confirm.

Reset requests answer the same way whether or not the address exists, and accounts that cannot be reset (federated users, service accounts) get no email. Every remembered device is revoked and outstanding refresh tokens are cut off once the password changes.

Administrators have two tools for people who have lost their device. They can reset a user’s second factors (it clears the factors, recovery codes and remembered devices, and the user enrols again at next sign-in), and they can send a password-reset email that also clears 2FA. Both are available to client administrators for users of their own clients, which keeps lost-device recovery with the people who know the user. Both need the platform:iam:user:reset-2fa permission (held by the built-in iam-admin and client-admin roles); approving a queued reset needs it too. A role that could already update users was granted it when the permission was introduced.

Brute-force protection sits in front of the password check, and of the passkey and second-factor steps, with two layers:

Layer Default What it stops
Per email and client address: the first 3 failures are free, then the wait doubles from 2 seconds up to 5 minutes FC_LOGIN_BACKOFF_FREE_ATTEMPTS=3, FC_LOGIN_BACKOFF_BASE_SECS=2, FC_LOGIN_BACKOFF_MAX_SECS=300 Guessing from one place, without locking out the real user elsewhere
Per email, any address: 100 failures within an hour lock the account for 15 minutes FC_LOGIN_GLOBAL_CEILING=100, FC_LOGIN_GLOBAL_WINDOW_SECS=3600, FC_LOGIN_GLOBAL_LOCK_SECS=900 Guessing spread over many addresses

A throttled request gets 429 with Retry-After. Every attempt, successful or not and human or machine, is recorded as a login attempt. Separate rate limits apply to reset requests per address and per email.

One policy applies wherever the platform sets a user’s password: when an administrator creates a user, on change password, on reset and on the set-your-password link of an invitation. It follows the shape of NIST SP 800-63B: length, a list of common passwords, and nothing derived from the person. It has no composition rules, because mandatory digits and symbols mostly produce Password1!.

Rule Code
8 to 128 characters PASSWORD_TOO_SHORT, PASSWORD_TOO_LONG
Not one character repeated PASSWORD_TOO_WEAK
Not the email, its local part, or a word of the name, forwards or reversed PASSWORD_CONTAINS_IDENTITY
Not one of the 10,000 most common passwords, and not based on the product name PASSWORD_TOO_COMMON

Passwords are hashed with argon2id (64 MiB, 3 iterations), and each stored hash records its own parameters so they can be raised later without a migration.

An application that manages its own users’ passwords through the API can set enforcePasswordComplexity: false on a password reset. The platform then applies only a minimal length floor, and the application owns the rules.