Reputation: 99
I am making a file hosting.
I need to know if it's safe to store tokens after user authentication to Local Storage.
Upvotes: 1
Views: 734
Reputation: 1109
There are two problems when using the localStorage :
So, depending of what you store, it would be a security issue...
But why do you want to use localStorage instead of standard cookies ?
Upvotes: -2
Reputation: 4045
Depends what kind of token really.
If they're oAuth2 bearer tokens, it's safe to store them: After all, the server will later know whether that token is too old and will ask you to renew it.
If it's an oAuth2 refresh token on the other hand, it should never even reach the client.
Other kinds of token? It will depend on their characteristics.
Upvotes: 3