Understanding JWTs

Understand the structure of a JSON Web Token and its role in authentication.

Before writing the authentication feature, let’s explain what a JWT is. JWT stands for JSON Web Token. It’s one of the most used means of authentication in web applications but also helps with authorization and information exchanges.

According to RFC 7519, a JWT is a JSON object defined as a safe way of transmitting information between two parties. Information transmitted by JWT is digitally signed so it can be verified and trusted.

Parts of a JSON Web Token

A JWT contains three parts—a header (x), a payload (y), and a signature (z)—that are separated by a dot:

Get hands-on with 1200+ tech skills courses.