What is Json Web Token or JWT | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

What is Json Web Token or JWT

When we login so a single jwt is generated or a jwt is generated on our each and every request or activity which we perform on the server

26th Feb 2022, 7:01 AM
Zainul Khan
Zainul Khan - avatar
3 Respostas
+ 1
The JWT is an access token created and signed by the server after login. You need to send it with each request in order to prove the server who you are. So the JWT is created by the server. And you will send it to the server with each request. The server will verify the token each time.
26th Feb 2022, 9:20 AM
Mustafa A
Mustafa A - avatar
+ 1
To understand the function of a jwt token, we need to know how the login auth flow works between webpage and server. 1. Web page login with username and password. 2. Web server verifies the username and password with auth database table. 3. If user verification successful, server retrieve the userid from the username, it would then convert the userid to a jwt token code. And send the success response and the jwt token to the webpage. 4. Webpage would store the jwt token on the browser cookie 5. If webpage reload or navigate to a new page, browser would send the jwt token back to server. 6. server would validating the jwt token, and decode the userid from token. If it is valid token, server would response to the webpage with the right webpage contents, with user information on it if required.
5th Mar 2022, 5:47 AM
CalviÕ²
CalviÕ² - avatar
0
Mustafa A Thanks
26th Feb 2022, 9:37 AM
Zainul Khan
Zainul Khan - avatar