JWT (JSON Web Tokens) - vignesh01105/UserLoginSystem GitHub Wiki
Usecase
- User dont want to send credentials every time when they access resources in application.
- Rather then sending credentials, user can send JWT token to server saying that this is my token, please validate and send response.
JWT Elements
- Payload (User data such as issue, expiry)
- Header (Using Algorithm)
- Data Signature
How to use JWT
- When User login, client send credentials to server to validate.
- In response the server is generate JWT token and send it back to client.
- When client sending the next request, it also add the JWT token in the request.
- Server validates token and send back the response.
- This methodlogy is mainly focused on accountability not secrets.
- But if you want to generate token in secret make the method as https.