Where can we store the JWT token securely?

Viewed 225
1. User will do the login UserName and password.
2. If the login success then server will return JWT.
3. Now we will store the token.
4. Now for every request we will send the  JWT Token for authentication on server.

My question is that Where can we store the JWT token because Local storage,Session,Cookies is not safe.

2 Answers

"Only the server should know the "secret" that is used to generate the JWT. If someone modifies the data contained in the JWT, the server will fail to decode it. So the server can trust any JWT that it can decode."

You don't need to store JWT token where someone can't find. And if you think if hackers get token of someone, there is a expiration date option for this.

Check this: How safe is JWT?

Related