Authentication is the claim an API makes about who is on the other end of the connection. Get it wrong and every control downstream is meaningless: authorization checks, rate limits and audit logs all rest on an identity the attacker has already forged. OWASP ranks Broken Authentication second among API risks because the mistakes are common, the mechanisms are complex, and a single flaw hands over accounts wholesale.

The category is broad by design. It covers any weakness that lets an attacker assume another user's identity: credential stuffing that meets no rate limit, tokens that never expire or are signed with a guessable secret, a password-reset flow that leaks or accepts predictable codes, or an endpoint that accepts an unsigned JWT because the server trusts the alg header the client sent. What unites them is that the API believes a lie about who is calling.

Where authentication breaks

Broken Authentication: When the API Front Door Doesn't LockDiagram with these labels, in reading order: ATTACKER; AUTH ENDPOINT; ACCOUNT; stuffing / forged JWT; unverified claim; takeover; Attacker; Login / reset; / refresh; Token verification; Server trusts; the claim; Victim account; + all it can reach; alg:none / no rate; limit; Account and all it; reaches.ATTACKERAUTH ENDPOINTACCOUNTstuffing / forged JWTunverified claimtakeoverAttackerLogin / reset/ refreshToken verificationServer truststhe claimVictim account+ all it can reachalg:none / no ratelimitAccount and all itreaches
Forge or brute-force the identity and every downstream control inherits the lie.

APIs authenticate differently from the web apps that preceded them. There are no sessions tied to a browser, no server-rendered login page, just tokens, keys, and machine-to-machine flows that developers frequently roll themselves. That is where the cracks appear. The login endpoint is exposed to automation and often lacks the brute-force protection a human-facing form would have. Token handling invites subtle errors: accepting the none algorithm, failing to verify the signature, or embedding no expiry.

Account-recovery flows are a favorite target because they are, by definition, a way to gain access without the password. A reset code that is short, numeric, and unthrottled can be brute-forced; a reset link that leaks in a referer header or is guessable by timestamp is no better. Machine credentials are another weak point: API keys pasted into mobile apps or committed to public repositories turn authentication into a scavenger hunt that an attacker often wins without touching your servers.

An unsigned token the server should reject, but sometimes doesn'tPOST /api/orders Authorization: Bearer eyJ...
Header decodes to: {"alg":"none","typ":"JWT"}, signature stripped, identity forged
Why it's API2: Authentication sits at the root of the trust chain. A broken object-level check leaks one type of record; broken authentication leaks the account itself, and with it every object, function, and flow that account can reach.

What good authentication requires

The core discipline is to treat authentication as a security-critical component that you configure rather than invent. Use vetted, standard mechanisms; assume every credential endpoint is under automated attack; and verify tokens strictly, on the server, every time.

  • Rate-limit and monitor every credential endpoint. Login, token issuance, and password reset must throttle attempts and lock or challenge after repeated failures. Credential stuffing stops only when the endpoint adds friction.
  • Verify tokens strictly. Reject the none algorithm, pin the expected signing algorithm server-side, validate signature, issuer, audience, and expiry, and never trust claims the client can set.
  • Harden account recovery. Reset codes must be long, random, single-use, and short-lived; the flow should reveal nothing about whether an account exists and must be rate-limited like login.
  • Require strong authentication where it counts. Enforce multi-factor authentication for sensitive operations, and prefer short-lived tokens with refresh over long-lived bearer credentials.
  • Treat API keys as secrets that identify a client. Do not embed them in client-side code, rotate them, scope them narrowly, and scan repositories and mobile bundles for leaks.

Authentication is deceptively hard because it is a system rather than a single check: login, tokens, refresh, recovery and machine credentials all have to hold at once, and an attacker needs only the weakest of them. That is also why authentication flaws hide: the login page looks fine while the forgotten reset endpoint quietly accepts a four-digit code. You cannot harden the front doors you have not inventoried, which is why finding every authenticating endpoint comes before locking any of them.

Primary source. API2:2023 Broken Authentication, OWASP API Security Project, 2023.

Back to the knowledge baseRequest an assessment