A signed note the server can trust without looking anything up.
2a
Take a real token apart, then try to forge one. Walk it with Next.
2b
Registered claim names are short on purpose — the token travels with every request.
import "github.com/golang-jwt/jwt/v5" claims := jwt.MapClaims{ "sub": "42", "role": "user", "iat": now.Unix(), "exp": now.Add(15 * time.Minute).Unix(), } tok := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) s, err := tok.SignedString(secret)
header {"alg":"HS256","typ":"JWT"}
payload {"exp":1790000900,"iat":1790000000,"role":"user","sub":"42"}
forged : token signature is invalid: signature is invalid
genuine: <nil>
16m later: token has invalid claims: token is expired
exp is checked by the library automatically — an expired token fails Parse.exp.exp, wait, parse again.Recap
base64(header).base64(payload).signature.sub, iat, exp on every access token; keep exp short.