A JSON Web Token (JWT) is a safe, compact, and self-contained way of transmitting information between multiple parties in the form of a JSON object.
A JSON Web Token consists of three parts that are separated by a “.”. They are: Header, Payload, Signature
The header typically consists of two parts: the token’s type, and the hashing algorithm that is being used.
{
"alg": "HS256",
"typ": "JWT
}
The payload is where the actual information that we want to send is stored.
{
"id": "65165751325",
"name": "Kurt DiPaolo",
"admin": true
}
The signature is used to verify that the message was not altered before reaching its destination. This is usually done by using private keys.
https://blog.bitsrc.io/understanding-json-web-token-authentication-a1febf0e15