I have a Rails app and I'm trying to connect to an API.
I've been able to ping the API and send form data and everything comes back OK. The question I have is the API requires you to send a JWT authentication token with your request. So I was making this additional authentication request to get the JWT and then sending that JWT with the other API calls I was making.
The API recommends saving the initial JWT so I don't have to make the additional authentication request for the JWT. They recommend saving it for a certain amount of time and refreshing and getting a new JWT after that time. The token will be valid for 25 hours so they recommend getting a new token after 24 hours to not interrupt any services when retrieving the new JWT.
Where would I store this token? I was thinking in a session or caching it maybe? I feel like there may be security concerns with storing it in a session?
Just looking for inputs on best practices and where one would store a JWT in their App. Also do not bother telling me my question to too general or SO isn't the place to ask for opinions. I'm doing it. Thug life.