TL;DR
JWT may be a part of a properly designed authentication protocol. Alternatively it may serve only for authorization without authentication.
Ticket analogy
If you buy a movie ticket, it may advertise, depending on cinema and local laws:
- your name
- age
- seat number
- time and date of the movie session
- internal tracking number
- QR code
- or none of these things
The only mandatory property of a ticket is a hard to fake feature like a watermark or a hologram, that will be checked upon entrance, identify the ticket as legitimate and let you in.
Cinema theater can choose to put as much information in it as they want. Sure, a gate attendant trusts that whatever is printed on a ticket was at one point a belief of a cashier. But that is just payload, conceptually, only ticket fake-proofing is important.
In particular, ticket owner might be a mugger and not a buyer, cashier could be wrong or compromised, gate attendant can apply any additional checks or policies. Ticket does not adress these concerns.
JWT is like a movie or a bus ticket - it grants you access to something without any identification or association with a buyer.
Paper tickets are easier to invalidate upon contact, so analogy is not exact.
Authenticantion protocol requirements
Formally a signed JWT is an integrity-protected transport channel from a trusted party to an undefined count of clients over untrusted media and nothing more. What data is being protected is an application level concern and is for protocol author to decide.
Importantly, JWT does not authenticate on its own. It just proves that presenter of the token has access to the same information as its original recepient - i.e. the presenter is either:
- legitimate client
- legitimate server
- MitM
- client's friend
- client trojan
- server trojan
The default contract implies:
- server and client are not compromised
- communications are securely encrypted
- client does not share the token.
Only then authentication infromation, if any, delivered via the token can be trusted.