I'm considering the use of SNS to send POST request to customer API from a Lambda function. My difficulty is how to manage the fetch of the token and token refresh. The goal is to first do a request to get a token, using Basic authentication and then, with a valid token, do the POST request whenever I get a new message on the corresponding topic. Additionally I'd like to understand if the token refresh process can be managed out of the box with SNS.
Thanks
OAuth 2 is not supported via SNS - the only options is Basic and Digest auth: https://docs.aws.amazon.com/sns/latest/dg/sns-http-https-endpoint-as-subscriber.html