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
3 Respuestas
+ 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.
+ 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.
0
Mustafa A Thanks