The Signature ensures that a JWT has not been altered and verifies the sender's identity.
The Signature part of a JWT is created by taking the encoded header, the encoded payload, a secret, and the algorithm specified in the header. This Signature is used to verify that the token sent by a client has not been tampered with and that it was issued by a legitimate source. In a Java application, verifying the Signature can be done using libraries like JJWT, which ensure that only authorized clients use the token.
Additional Notes
Why does the Signature in a JWT matter in this design?