What is JWT (JSON Web Token)?
A format for passing information (claims) in JSON form with a signature attached. Its three parts, "header.payload.signature", are each encoded with Base64URL and joined with ".". The signature lets the receiver check for tampering and confirm the issuer, but in a typical signed JWT the payload is not encrypted, so no secret information should be put in it. It is used for access tokens for API authentication and for OpenID Connect ID tokens, among others, and is usually given a short expiry (exp).
Japanese name: JWT(JSON Web Token)
JWT (JSON Web Token) appears in 2 practice questions across 1 topic, including Web Technology Basics.
Field: Web Technology Basics
FAQ
Should I use a JWT or a session ID?
A session ID is just a key for looking up information stored on the server, so logouts and invalidations take effect immediately on the server side. A JWT can be checked without storing information on the server, which suits passing it between several services, but it has the weakness of being hard to revoke. For logging in to a single website, a session ID is often easier to handle.
What is the difference between Base64URL and Base64?
Base64URL is a variant of Base64 that replaces "+" and "/", which have special meanings in URLs, with "-" and "_", and often omits the trailing "=". JWTs use this form so that they can be put into URLs and HTTP headers as they are. Neither is encryption; anyone can decode them.