A JSON Web Token is three chunks of text glued together with dots, in the form
header.payload.signature. The header and payload are each just a JSON object,
written in base64url so they are safe to put in a URL or an HTTP header. Base64url is an
encoding rather than encryption, so anyone holding the token, including this page, can
read both of them without a password or a key.
The header says how it was signed
The header usually has two fields. The first, alg, names the signing
algorithm, and the second, typ, is almost always the literal string
JWT. alg can legally be the
string none, which means the token is not signed at all. A responsible
server must check that alg is one it actually expects before trusting the
token's claims.
The header can also say which key to check the token with. kid is a key ID,
which the checker looks up in a set of keys it already trusts, usually a set the issuer
publishes. A few other fields, jwk, jku, x5c and
x5u, go further and carry the key itself or a web address to fetch it from.
A key is not trustworthy just because the token brought it, since anyone can make a key
and sign a token with it. It only counts once it is tied to something the checker already
trusts, such as a certificate chain that leads to a trusted root, a key address the issuer
is known to use, or a key the checker already holds. When any of these fields appear,
this page lists them in the summary and explains what each one declares.
The payload carries the claims
The payload holds whatever the issuer wanted to say, which is usually who the token is
about, what they are allowed to do, and for how long. RFC 7519 gives a handful of fields
a fixed meaning, and this page picks those out and shows them in the summary above the
JSON:
iss is who issued the token.
sub is who the token is about.
aud is who the token is meant for, which can be one name or a list of them.
exp is the moment the token stops being valid.
nbf is the moment the token starts being valid.
iat is when the token was issued.
jti is a unique ID for this particular token.
exp, nbf and iat are seconds since 1 January 1970,
UTC. This page converts them into your own local time so you do not have to.
The signature is the part this page cannot check
Checking a signature proves the header and payload have not changed since they were
signed. That is how a server can trust the token, and checking it requires a key. There
are two kinds of keys:
-
HS256 and its relatives use one shared secret, which both signs and checks.
Anything that can check a token can also forge one, so that secret belongs on your
servers and nowhere else. This page will not ask for it.
-
RS256, ES256 and the rest sign with a private key and check
with the matching public key. The public key is safe to share, but this page cannot go
and get it for you, because it does not connect to anything outside this tab.
So this page shows you the signature's raw bytes and nothing more. A token that decodes
cleanly here is not necessarily genuine and should not be treated as such until the
signature is verified.
If you need to actually verify a signature, do it with the library your server already
uses to check tokens, using the same key it checks them against.