Demystifying JWTs

16:2015 mins08/11/2024

JSON Web Tokens (JWTs) have become a popular method for securely transmitting information between two parties. They are widely used in modern web applications for authentication and data exchange. However, their inner workings and security implications can be complex and often misunderstood by the developers.

In this talk, we aim to demystify JWTs by exploring their structure, how they work, and the cryptographic mechanisms that ensure their integrity and confidentiality. We will discuss the components of a JWT, including headers, payloads, and signatures, and illustrate how they combine to form a token.

Furthermore, we will dive into best practices for JWT usage, common pitfalls to avoid, and security considerations such as token expiration, payload size, and the choice of cryptographic algorithms. Finally, we will explore how a WebSocket connection can be secured with JWTs. Security is increasingly an overlooked necessity while utilizing a protocol that does not support authentication by default.

By the end of the session, attendees will have a clear understanding of how JWTs operate, their advantages over traditional session-based authentication, and how to implement them securely in their own applications.