I'm facing the need to store the access token of a user who logged in through a method with OAuth2, this JWT token will be used for my frontend application, written in React, to make calls to an API "on behalf of the user".
However, this data that in my view is sensitive as it should be stored on the client?
I know of some options like localStorage or cookies, but I would like to understand what are the pros and cons of any solution for storing this type of data.
Then, for your case, you can send a "setCookie" from your backend when logging in, then all other requests will send the cookie with the token to be validated.
Another thing you can do to increase security is, when generating the token, you generate a user fingerprint, something unique and automatically generated, with that you doublecheck the origin of the request