What Is a Jwt Token, and How Do We Use It?

JSON Web Tokens

Geno Tech
5 min readMay 26, 2023
Photo by FLY:D on Unsplash

This article will answer your questions like you still have no idea how JWT works or why you want to use it. Simply This is something related to the security of your software. So it’s very important to know these things. First, I’m telling you what JWT is, then I will talk about why you should use JWT, and finally, I will show you exactly how JWT works and how you can use it yourself.

Authorization vs Authentication

JWT is just for authorization, not authentication. They’re slightly different from authentication. In authentication, you’re taking the username and the password and authenticating to ensure that the username and password are correct. It’s like logging a user in. But authorization ensures that the user who sends the request to your server is the same user who logged in during the authentication process. It’s authorizing that this user has access to this particular website. That is normally done by using a session. For example, you have a session ID that you send down in the cookies of the browser and then every time the client makes your request, they send that session ID up to the server, and the server checks its memory and says ok, this user has a valid session ID. It finds that the user then does the authorization to ensure the user has access. But JWT…

--

--

Geno Tech
Geno Tech

Written by Geno Tech

Software Development | Data Science | AI — We write rich & meaningful content on development, technology, digital transformation & life lessons.

No responses yet