JWT
JSON Web Token (jwt) is a secure way to send information btw a client and server. it is used in web applications and APIs to verify users and prevent unauthorized accesses when jwt generates tokens its structure is Header ,Payload and signature
this is how jwt token works
login request the user logs in through the client application by sending their credentials (username & password) to the server.Server Generates JWT If the credentials are correct the server generates a JWT token using a secret key.if the jwt token gets expired token it will returns 401 unauthorized . Then Returns JWT The server sends the JWT back to the client application.
Further Requests with JWT For any subsequent requests, the client sends the JWT along with the request. The server verifies the JWT before granting access to protected resources.
Security considerations
use https prevent man in the middle attacks by transmitting JWTs over https . set expiration time prevent long-lived tokens that can be exploited.
and use secure storage to store jwt securely for example Http only cookies instead of local storage
Common issues with JWT
jwt Rejects the token if the token has expired, the signature is invalid, or the claims do not match the expected details.token does not support required scope the token does not include the permissions needed for the action.JWT
Jwt is a secure way to send information btw a client and server. it is used in web applications and APIs to verify users and prevent unauthorized accesses
when jwt generates tokens its structure is Header ,
Payload and signature
this is how jwt token works
login request the user logs in through the client application by sending their credentials (username & password) to the server.Server Generates JWT If the credentials are correct the server generates a JWT token using a secret key.if the jwt token gets expired token it will returns 401 unauthorized . Then Returns JWT The server sends the JWT back to the client application.
Further Requests with JWT For any subsequent requests, the client sends the JWT along with the request. The server verifies the JWT before granting access to protected resources.
Security considerations
use https prevent man in the middle attacks by transmitting JWTs over https . set expiration time prevent long-lived tokens that can be exploited.
and use secure storage to store jwt securely for example Http only cookies instead of local storage
Common issues with JWT
jwt Rejects the token if the token has expired, the signature is invalid, or the claims do not match the expected details.token does not support required scope the token does not include the permissions needed for the action.
Jwt is not Encrypted
Like JWT is encoded, not encrypted
And anyone can decode payload base64
jwt is stateless servers does NOT store session data
Basic question
What is a common issue present in it ?
20 feb logs
- understanding owasp top 10
- I'll be start focusing onbug bounty bcz I 've been exploring web app security for almost a month now.
- 26% done on my pre-security path on TryHackMe.