JWT is a way of encrypting information. A JWT consists of three parts: header, payload, and signature.
JWT is composed of three parts: Header, Payload and Signature. The header contains metadata about the token, such as the encryption algorithm used and the token type; the payload contains the payload data, which is the actual transmitted information; the signature is a cryptographic signature of the header and payload to verify their integrity and authenticity The sexual part.
Token is a credential used for authentication and authorization. It is usually generated by the server after the user logs in and sent to the client. The client sends this token back to the server on future requests to prove its identity and obtain authorization.
In general, JWT is mainly used to securely transmit information between web applications, while Token is mainly used for authentication and authorization.
Token data processing:
Token can actually be called a secret code in a more popular way. Before some data is transmitted, the secret code must be checked first. Different secret codes are authorized by different Data manipulation. For example, four types of data packets are defined in the USB1.1 protocol: token packet, data packet, handshake packet and special packet.
The exchange of continuous data between the host and the USB device can be divided into three stages. In the first stage, the host sends a token packet. Different token packets have different contents (different passwords) and can tell the device what to do. Different jobs, the second stage sends a data packet, and the third stage returns a handshake packet from the device.