I have setup api gateway with cognito authentication, but need to pass some of the requests to another rest service which has own authentication where you need to supply clientID and secret to receive a bearer token that is valid for several hours.
I do not need to make any change to the request, just add the token and pass it to the rest service and receive the answer and pass it to the client.
As the token will be valid for several hours, I do not want to ask for the token with every request to save time.
Where can I persist the valid token? Api-gateway or a lambda function? Lambda function is stateless and has no storage as far as I know.
Thanks