JWT Token :
Header:
Payload:
Key:
Private Key:
Public Key:
Four easy steps:
Notice: The jwt token is not uploaded to the server, all encryption and decryption are done on the client side.
JWT is the abbreviation of JSON Web Tokens. It is the most popular cross-domain authentication solution. It is an open standard (RFC 7519) for securely transmitting information between parties in JSON objects.JWT token consists of three basic parts:Header,Payload,Signature, The Header part includes the JWT type and the signature algorithm used. For example, the Header of a JWT using the HMAC SHA256 algorithm may be as follows:
{
"alg": "HS256",
"typ": "JWT"
}
alg is the encryption algorithm, This Header will be Base64Url encoded to form the first part of the JWT. Payload is used to store the actual data that needs to be transmitted. There are 7 official fields specified by JWT for selection:
The Signature part is a signature of the Header and Payload, which is used to verify the authenticity and integrity of the JWT. The signature generation process involves encrypting the Header and Payload using the specified signature algorithm and key. This signature will be added to the last part of the JWT to ensure that the JWT will not be tampered with during transmission.