A two-hour bug at Nango forced hundreds of users to reauthorize their accounts
What we learned operating auth for 1k APIs
Nango, an open-source auth platform now covering 1,000+ APIs, describes how a single faulty condition silently discarded refreshed tokens for hundreds of connections. Because providers like Airtable and Slack invalidate old refresh tokens on rotation, the damage was irreversible. The team now treats refresh tokens like money, serializes refreshes behind a distributed lock, and handles undocumented quirks such as missing expiry fields, 200-status auth errors, and providers that break their own auth contracts.
We now treat refresh tokens like money, not cache.
- cryptonector
Even `expires_in` requires care. The token expires in 3600s, but, from when? In the token there will be an `exp` with an absolute value, but `expires_in` in the envelope is relative -- relative to when? Relative to whenever the issuer issued the token, so relative to `iat`/`exp`. But you don't want to have to extract that from the token, and you won't get to if the token is encrypted, so the best you can do is add `expires_in` to now, but it has to be a clock value from before you send the request.
- gnabgib
900 (2 points, 3 months ago) https://news.ycombinator.com/item?id=49258375
100 (99 points, 7 months ago, 26 comments) https://news.ycombinator.com/item?id=47579818
- cpursley
Nango is a nice product. For folks in the Elixir ecosystem, here’s a drop in library that is compatible with their provider library for the oauth management side of things: https://github.com/agoodway/tango