wire / wire-format / jwt-structure

JSON Web Token (JWT) structure

A JWT is three Base64url-encoded parts separated by dots: header.payload.signature. The header declares the algorithm (alg) and token type (typ). The payload carries claims (iss, sub, aud, exp, iat, nbf, jti, plus custom). The signature is computed over 'header.payload' using the declared algorithm (HMAC, RSA, ECDSA, EdDSA, or none).

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: JSON Web Token (JWT) structure

wire format

spec: RFC 7519 (JWT), RFC 7515 (JWS), RFC 7516 (JWE)

A JWT is three Base64url-encoded parts separated by dots: header.payload.signature. The header declares the algorithm (alg) and token type (typ). The payload carries claims (iss, sub, aud, exp, iat, nbf, jti, plus custom). The signature is computed over 'header.payload' using the declared algorithm (HMAC, RSA, ECDSA, EdDSA, or none).

fieldsizemeaning
HeadervariableBase64url(JSON) object: {"alg":"HS256","typ":"JWT"}.
Separator1 byte'.' (0x2E).
PayloadvariableBase64url(JSON) object with registered/public/private claims.
Separator1 byte'.' (0x2E).
SignaturevariableBase64url of the signature over ASCII('header.payload') using alg.

example:

65 79 4a 68 62 47 63 69 4f 69 4a 49 55 7a 49 31 4e 69 49 73 2e 65 79 4a 70 63 33 4d 69 4f 69 4a 42 51 6b 4e 45 51 53 49 73

Base64url of '{"alg":"HS256","typ":"JWT"}.{"sub":"1234567890"}' prefix


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/jwt-structure or /wire-format/jwt-structure.json