JWTs
Token Characteristics
Format
How is it encoded
By value
Contains all the details within it, can be validated by the receiver without calling the AS, can be encrypted/signed
By reference
Random string that acts as a reference to a db entry; only the AS can read it
Purpose
Who is it for
Access token
Resource Server
Refresh token
Authorization Server
ID Token
Client (OpenID Connect)
Type
How can it be used
Bearer
Coin analogy: if you find one you use it wihtout proving that it's yours
/
Credit card analogy: you need proof of ownership to use them (sender-constrained tokens, i.e., bound to a single user)

Bearer
and a DPoP
token (image adapted from here).JSON Web Tokens
JWT is a format that can be used for many purposes, such as ID Tokens (always JWTs), access tokens (can be JWTs), and refresh tokens (almost never JWTs). Most often are signed (JWS), but they can also be encrypted (JWE). They are Base64 encoded, start with ey
, and can be decoded using https://jwt.io/ or using jwt_tool.py
.

The JWT signature is typically generated by hashing the header and the payload. The resulting hash might be also encrypted. In both cases, the process involves a secret signing key which provides a way for servers to verify that the token data hasn't been tampered with.

Last updated
Was this helpful?