Also known as: JSON Web Token, access token
Definition
A JWT is a signed, base64url-encoded token carrying claims about a user. Supabase issues JWTs after authentication, signs them with ES256 asymmetric keys (default for new projects since October 2025), and Next.js apps validate them server-side via getClaims without a network round trip to the auth server.
A JSON Web Token is a three-part string: header, payload, and signature, separated by dots and base64url-encoded. The payload carries claims like sub (user ID), exp (expiry), and Supabase-specific claims like aal (MFA state) and role.
The signature is the cryptographic guarantee. Anyone can read the claims, but only the auth server (with the private key) can produce a valid signature. Any tampering invalidates the token.
Server-side via getClaims(), which fetches the project's public key from the JWKS endpoint (cached locally), then verifies the signature with the Web Crypto API. No HTTP request to Supabase Auth is needed per validation. The older getSession() method reads the cookie without re-validating the signature and should never be used for authorization.
In httpOnly cookies, written by @supabase/ssr. Never in localStorage, which is readable by any inline script and turns an XSS bug into a session-theft incident.