QuestionOur login endpoint suddenly answers 429
errors.auth.login_rate_limited. Sometimes it is a single user who mistyped a password, sometimes a whole office or a load-test machine. Which limit am I hitting and what can I change?
AnswerThere are two independent limits, and only one of them is configurable. The response does not tell you which one fired (on purpose, so an attacker cannot tell whether a username exists): you work it out from the pattern.
- Per user, always on. 5 wrong passwords for the same username within 5 minutes lock that username for 60 seconds. The username is compared trimmed and case-insensitive, and a successful login clears its counter. It cannot be disabled.
- Per IP, off by default. It is controlled by
loginRateLimitPerIpPerMinute. With the default 0 nothing is counted. With a value above 0, every login attempt from that IP (failed and successful) is counted in a one-minute window, and when the limit is crossed the IP is locked for 60 seconds.
So a 429 for a single account that keeps failing is the per-user limit: wait for
retryAfterSeconds (it is in the error arguments) and enter the right password. A 429 for many different users coming from the same address means someone set the per-IP value, typically to
30, and a shared NAT, a stress test or a CI runner is exceeding it.
Both keys live in
AppSettings and are read on every call, so no restart is needed:
"AppSettings": {
"loginRateLimitPerIpPerMinute": "120",
"loginRateLimitExemptIps": "10.0.2.2, 192.168.1.50"
}
loginRateLimitExemptIps is a comma-separated list of addresses that are never limited and never counted. Loopback is always exempt. Do not exempt a public-facing address just to silence a test: on an exposed installation the per-IP limit is your protection against credential stuffing across many usernames, so raise it or exempt only known internal sources.
Documentation: Troubleshooting & Best Practices