wire / wire-format / 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).
aka: JSON Web Token (JWT) structure
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).
| field | size | meaning |
|---|---|---|
| Header | variable | Base64url(JSON) object: {"alg":"HS256","typ":"JWT"}. |
| Separator | 1 byte | '.' (0x2E). |
| Payload | variable | Base64url(JSON) object with registered/public/private claims. |
| Separator | 1 byte | '.' (0x2E). |
| Signature | variable | Base64url 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
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/jwt-structure
or /wire-format/jwt-structure.json