0
Challenge · 50Auth: Who Is Asking?
Asymmetric JWT signing keys & JWKS
Authused in ~55% of apps
A teammate leaks the project's JWT secret. You rotate it immediately, congratulating yourselves on a fast response — and every currently signed-in user on DevLog is logged out at once, mid-session, because verifying any token, old or new, required that exact secret and it no longer exists. That is the world symmetric signing forces you to live in. It is not the world Supabase ships by default anymore, and knowing why is what makes getClaims() (concept 49) actually work the way it claims to.
Core idea. Supabase signs every user's JWT with a private key that never leaves its servers, and publishes the matching public key at a JWKS endpoint — so anyone who needs to check a token (your server, calling getClaims()) can verify its signature locally, with no network call and no shared secret to protect. Because signing and verifying use two different keys, rotating the signing key is zero-downtime: a new key issues new tokens immediately, while the old public key keeps validating tokens already in flight until you deliberately revoke it.
poke it, drag it,
try to break it
try to break it
no slides here.
you drive.
you drive.
Playground, this isn't a screenshot
| Symmetric (HS256, legacy) | Asymmetric (ES256, current) | |
|---|---|---|
| Who can sign | Anyone holding the shared secret | Only Supabase — the private key never leaves |
| Who can verify | Also only the secret holder — same object as signing | Anyone, from the published public key |
| Verify without a network call? | Only if you have a local copy of the secret | Yes — WebCrypto against a cached public key |
| Rotation cost | Every unexpired token everywhere is invalidated at once | Zero-downtime — old key keeps validating until revoked |
↑ play a little first, then dig in