The payload is the main part of the token. It contains claims (statements about an entity, such as the user) and additional metadata.
The JWT standard defines the following three types of claims:
- Reserved claims: A set of predefined claims, which are not required but recommended. Here are some of the most common reserved claims (for a complete list, check out the standard RFC 7519):
- iss: This indicates the issuer of the token. This can be set to the name of the service, domain, or URL, for example, reduxblog.
- sub: This indicates the subject of the token. This can be set to, for example, a unique user ID. In our case, we will use the unique username, for example, dan.
- exp: This indicates the expiration time of the token. After this ...