JWT Structure Explained
A JWT consists of three Base64URL-encoded parts:
1. Header
``json
{
"alg": "HS256",
"typ": "JWT"
}
`
Specifies the signing algorithm and token type.2. Payload
`json
{
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022,
"exp": 1516242622
}
``
Contains the claims (statements about the user and metadata).3. Signature
Created by signing the header and payload with a secret key.Common JWT Claims
| Claim | Name | Description | issIssuerWho issued the token subSubjectWho the token represents audAudienceIntended recipient expExpirationWhen the token expires iatIssued AtWhen the token was created nbfNot BeforeToken not valid before this time