JWT consists of three parts: header, payload, and signature. In the header, we define the encryption algorithm HMAC sha256.
Finally generated token = header_base64 . payload_base64 . signature_encryption .
The hmac here is an irreversible algorithm. How is it possible to parse the original information (such as the expiration time in the payload) from the token for judgment.
I don’t know where I misunderstood JWT.
怪我咯2017-05-24 11:40:28
You misunderstood. In fact, the encryption process is signature.
If the signature calculation is inconsistent, it is considered that the token has been tampered with. In fact, the first two fields are not encrypted, just base64
怪我咯2017-05-24 11:40:28
JWT uses . to connect all values. . . The signature is determined by the backend to determine whether it has been tampered with, and the information is in the header and payload