Safety & security

JWT

AI-assisted editorial review:

JWT (JSON Web Token, often pronounced "jot") is a compact, URL-safe format for passing claims, such as who a user is and what they may access, between two parties. The IETF published it as the standards-track RFC 7519 in May 2015.[1][3] A JWT is usually signed so the receiver can detect tampering, and it can also be encrypted.[1][6] It is widely used for sign-in and API authorization: OpenID Connect ID tokens are always JWTs, and many OAuth 2.0 access tokens are JWTs as well.[2][3][5]

What does JWT mean in simple terms?

When you sign in, the server can hand your app a long string that often starts with "eyJ". In this example, that string is a signed JWT. It has three parts separated by dots: a header, a payload with the claims (user ID, expiry time and so on), and a signature.[4][6] The app attaches the token to later requests, typically in an "Authorization: Bearer" header, and the server checks the signature and expiry instead of asking for the password again.[4][6] Because the token itself carries the needed information, the server can often skip a database lookup.[3][6] One caution: signing protects the content from being changed, not from being read. Anyone holding the token can decode the payload, so it should not contain secrets.[3][6] Sign-in with Google or Kakao (with OpenID Connect enabled) returns an ID token in JWT form, and Supabase Auth issues JWT access tokens. OAuth access tokens in general may be JWTs or opaque strings, depending on the provider.[3][4][7][8] Encrypted JWTs use a different structure and cannot be read by simply decoding their payload.[1]

How can JWT be explained with an analogy?

A JWT is like a casino chip. At the entrance you exchange cash (your password) for chips, and from then on you play with chips only. The casino can tell a genuine chip from a fake by its markings, the way a server checks a signature. Unlike a chip, a JWT should expire after a while, and anyone who steals it can use it until then.

Where is JWT used?

Case 1

Supabase — One token carries identity and permissions

Supabase Auth issues a short-lived JWT access token for each signed-in user and keeps issuing new ones while the session lasts.[4] Each Supabase product verifies the token it receives, then uses the "role" claim and Postgres Row Level Security policies to decide which data the user may access.[4] Even requests made with a Supabase publishable or secret API key are turned into a short-lived JWT behind the scenes before data access is authorized.[4] Public keys for verification are published at a JWKS URL, and Supabase strongly recommends asymmetric signing keys over a shared secret.[4]
Result: A signed token carries the user's identity and role to the database layer without an extra lookup on each request.[4]

Case 2

Sign in with Google and Kakao — ID tokens are JWTs

Google's OpenID Connect documentation states that an ID token is a JWT, a cryptographically signed, Base64-encoded JSON object, and that it can be verified with Google's public keys listed at the "jwks_uri" in its discovery document.[7] Kakao Login issues an access token and a refresh token under OAuth 2.0, and adds an ID token when OpenID Connect is enabled. Kakao's ID token is a JWT signed with RS256, verified with public keys from Kakao's JWKS endpoint.[8] Neither page describes the format of the access token, so apps should not assume it is a JWT.[3][7][8]
Result: In both services, the user's identity reaches the app as a JWT ID token that the app verifies with published public keys.[7][8]

Case 3

Known attacks — Why libraries and settings matter

RFC 8725 documents real attacks on JWT implementations. Attackers changed the "alg" header to "none" so that some libraries accepted tokens without checking a signature, or switched RS256 to HS256 so that a public key was misused as a shared secret.[2] Weak, human-memorable secrets for HS256 can be brute-forced once a token leaks.[2] The fixes are to allow only specific algorithms, use strong keys, and validate issuer and audience.[2] RFC 9068 applies the same lessons to access tokens: they must be signed, must not use "none", and must carry the type "at+jwt" so they cannot be confused with ID tokens.[5]
Result: The IETF published these practices as BCP 225 (RFC 8725) in February 2020.[2]

Why it is widely used

First, it can be stateless. The receiver can check the token's signature itself, without calling the issuing server or querying a session database.[3][4][6]

Second, it suits distributed systems. Services in different places can verify the same token with the issuer's published public keys. RFC 9068 notes this is especially common when the authorization server and the API are run separately.[2][4][5]

Third, it works closely with OAuth and OpenID Connect. Google and Kakao issue OpenID Connect ID tokens as JWTs, and RFC 9068 standardizes JWT access tokens for OAuth 2.0.[5][7][8]

Try it today

  1. Look at a token from your own test environment, decode the payload (for example in the jwt.io debugger), and check the "iss", "sub", "aud" and "exp" claims. Avoid pasting production tokens into online tools.[1][6]
  2. Verify tokens with a maintained library instead of writing your own code, fix the list of allowed algorithms, and check issuer and audience.[2][4][6]
  3. Keep personal data and secrets out of the payload, send tokens only over HTTPS, and keep tokens small, since some servers reject headers larger than 8 KB.[3][6]
  4. Prefer asymmetric signing keys (RSA or elliptic curve) over a shared secret, and plan for key rotation.[4][5]
  5. Keep access tokens short-lived and do not keep tokens longer than needed.[4][6]

Limits and direction

A valid JWT can remain usable until expiry unless the application has an earlier rejection mechanism. Early revocation needs additional design, such as a token denylist or session checks; shorter lifetimes limit exposure, while revoking a signing key can affect all tokens signed with it.[4] Signed JWTs are readable by anyone who holds them, and RFC 9068 warns that clients should not build logic on reading access tokens, because the provider may switch to opaque tokens at any time.[3][5] Many past incidents came from implementation mistakes rather than the format itself, so RFC 8725 sets minimum practices for libraries and applications.[2] As JWTs are used for more purposes, explicit typing and separate validation rules per token type are recommended so a token issued for one purpose cannot be reused for another.[2][5]

How has JWT evolved?

2015-05
RFC 7519 published
The IETF published JSON Web Token as a standards-track RFC, together with the related JWS, JWE, JWK and JWA specifications.[1][2]
2020-02
JWT Best Current Practices
RFC 8725 (BCP 225) updated RFC 7519 with security guidance on algorithm checks, key strength and audience validation.[2]
2021-10
JWT access token standard
RFC 9068 defined a common JWT format for OAuth 2.0 access tokens so that API servers from different vendors can validate them consistently.[5]

Which concepts are related to JWT?

  • Used in
    OAuthOAuth 2.0 does not mandate a token format, but many access tokens are JWTs and RFC 9068 standardizes that format; OpenID Connect ID tokens built on OAuth are always JWTs.[3][5]

Which sources explain JWT?

  1. IETF RFC Editor — RFC 7519: JSON Web Token (JWT) (2015-05) — https://www.rfc-editor.org/rfc/rfc7519
  2. IETF RFC Editor — RFC 8725: JSON Web Token Best Current Practices (2020-02) — https://www.rfc-editor.org/rfc/rfc8725
  3. Auth0 Docs — JSON Web Tokens (accessed 2026-10-13) — https://auth0.com/docs/secure/tokens/json-web-tokens
  4. Supabase Docs — JSON Web Token (JWT) (updated 2026-10-12) — https://supabase.com/docs/guides/auth/jwts
  5. IETF RFC Editor — RFC 9068: JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens (2021-10) — https://www.rfc-editor.org/rfc/rfc9068
  6. jwt.io (Auth0/Okta) — Introduction to JSON Web Tokens (accessed 2026-10-13) — https://jwt.io/introduction
  7. Google for Developers — OpenID Connect | Sign in with Google (accessed 2026-10-13) — https://developers.google.com/identity/openid-connect/openid-connect
  8. Kakao Developers — Kakao Login: Utilize (OpenID Connect ID token) (accessed 2026-10-13) — https://developers.kakao.com/docs/latest/en/kakaologin/utilize