OOmnistu

Blog / Engineering Playbooks

Engineering Playbooks

Login and authentication basics: what OWASP's Authentication Cheat Sheet recommends

Review OWASP's guidance on passwords, authentication flows, account changes and defenses against automated login attacks.

OOmnistu
Reviewed 2026-11-16 · 6 min read

At a glance

  • OWASP calls MFA by far the best defense against the majority of password-related attacks.
  • Passwords under 8 characters are weak with MFA on, under 15 without (OWASP, citing NIST SP 800-63B).
  • Link federated identities by issuer + subject — never by matching email.
  • Device, IP and location are risk signals, not substitutes for authentication.

Many apps still enforce rules like "one capital letter, one number, one symbol" and "change every 90 days". OWASP's Authentication Cheat Sheet (https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html), drawing on NIST SP 800-63B, says something different. This article summarises the whole sheet, which we read on 15 November 2026. For storing passwords and for sessions, see our separate articles. This is a developer checklist from one source, not a certification of any system as secure.

Passwords

User IDs and usernames

Random user IDs avoid predictable or sequential values. Allow an email as a username only if it is verified at signup, and let users pick a non-email username. Do not allow sensitive internal accounts (for backends or databases) to log in through the front end.

Re-authentication

Ask for the current credentials before sensitive changes such as password, email, payment details or a new shipping address. Re-authenticate after risk events: suspicious activity, account recovery, or adding a trusted device. The sheet says to use a bound authenticator such as the current password or a passkey, not security questions, and to rotate sessions afterwards.

Generic error messages

Login, password recovery and signup should respond the same whether the user exists, the password is wrong or the account is locked. The sheet's examples: "Login failed; Invalid user ID or password." and "If that email address is in our database, we will send you an email to reset your password." Watch for differences in response time (a "quick exit" for unknown users reveals them) and in HTTP status codes. It admits generic messages can confuse real users, and suggests brute-force protection and CAPTCHA where messages cannot be generic.

Automated attacks

The sheet defines brute force (many passwords, one account), credential stuffing (pairs from other breaches) and password spraying (one weak password, many accounts).

Brute force

Many passwords tried against one account.

1 account

Credential stuffing

Email/password pairs taken from other breaches replayed here.

Many accounts

Password spraying

One common weak password tried across many accounts.

Many accounts

Defences are layered:

Other sign-in methods

OAuth is for authorisation to APIs; OpenID Connect adds identity (validate iss, aud, signature and exp of ID tokens). When linking a federated identity, key on iss plus sub, never auto-link by matching email, and require an authenticated session. TLS client certificates suit narrow cases such as intranets, not public sites. Make password-manager-friendly forms: standard HTML inputs with proper type.

More on federated sign-in

Changing the registered email address

OWASP gives a recommended process, since account takeover often starts here. Both variants first confirm the session is valid, describe the process, take the proposed new address, verify identity, store the change as pending, and use time-limited nonces in emailed links, with handling of the responses.

OWASP frames the MFA process differently because of the additional identity proof. This article does not establish any identity provider's current account-change behavior. Admins and help-desk staff also need social-engineering training.

Adaptive (risk-based) authentication

Illustrative password-based adaptive flow, after OWASP's guidance

Sign-inattempt Credentialsverified? Invalid: genericerrorcounted toward lockout invalid valid Context / risk checkdevice - IP - location -time - data sensitivity New / higher riskstep up: MFA new / risky Authenticatedsession MFA failed:denied, generic error familiar success failed Sign-in attempt Credentials verified? Invalid: generic errorcounted toward lockout invalid valid Context / risk checkdevice - IP - location -time - data sensitivity New / higher riskstep up: MFA new / risky familiar Authenticated session success failed MFA failed:denied, generic error
An illustration of one password-based flow, not a universal sequence: risk signals decide when to step up, never whether to skip authentication. Failed attempts get the same generic error and count toward lockout.

OWASP describes requiring different authentication depending on context: data sensitivity, time, location, IP address or device fingerprint. Example: MFA on the first login from a device but not later ones; or a day-long single sign-on session that asks again before the profile page. It says to use device fingerprints, IP addresses and remembered-device cookies as risk signals, not as substitutes for authentication, and to require a valid authenticated session before exposing private account data. The sheet lists design questions: which signals to monitor and how often to refresh them, how accurate they are, how a score maps to actions (allow, CAPTCHA, step-up MFA, block, revoke session), where the risk engine runs and its latency budget, how decisions apply consistently across web, mobile and API clients, and how to change or revoke tokens when a mid-session check escalates.

What to ask your developer

  1. What are our minimum and maximum password lengths, and do we check against a breached-password list?
  2. Do we force a periodic change, and if so why?
  3. Are our user IDs predictable?
  4. Do login, signup and recovery respond the same whether or not an account exists, including timing?
  5. Do we offer MFA, and what happens when someone changes their email address?
  6. How do we link federated identities?

Limits

We read the whole sheet. We did not read the sheets and standards it links (OAuth 2.0, NIST SP 800-63B-4 and 63C-4, ASVS), so those are only as summarised by OWASP. The sheet's SAML and enterprise remarks reflect its own view of the market and we did not check them. We quote no breach statistics. Regulated sectors may have extra rules. Our related articles cover multi-factor options, forgot-password flows, credential stuffing and session management in more detail.

By Omnistu.

Sources

Previous
API rate limits and spending caps: protecting your backend and your bill