I use spring boot resttemplate and delegate http communication to Apache HttpClient library. I have service A and B deployed in openshift which need to interact with service C. Service C is behind Kong Gateway and authentication is based on SSO and an identity server providing JWT access tokens, with refresh tokens as well.

My question is regarding authentication from Service A or B to C. Once authenticated in A or B, what is best mechanism to store securely JWT token in A and B? I was thinking of a cache or in service A and B or database and I understand for each service we need to store tokens separately. Is it a good practice to keep using refresh token forever, or to re-authenticate and get new tokens In intervals?