- 最新
- 投票最多
- 评论最多
Hello,
The body of the message sent by SNS will not contain the username and password. They can however, be accessed from the authorization token. Allow me to explain SNS message sending to a HTTP method with Basic Authentication.
This process involves two steps. One is for authentication and other is for the business logic. So SNS sends message to HTTPS URL where as the first step its checks the authentication. After the successful authentication, the message will be delivered to the the URL which is subscribed to the topic.
In order to have better understanding, let me provide an example. A HTTPS endpoint is created using API Gateway which has the backend integration configured with a Lambda function, and a Lambda function as a custom authorizer. Once the SNS topic publishes message to the API Gateway API’s https endpoint, which contains both the basic auth credentials (eg: https://admin:pass@domain.com), the Lambda authorizer will manage the authorisation. Only the notification body will be received by the backend Lambda integration.
In your case, you will need to check your endpoint’s authentication to retrieve the key value of the authorisation token which contains the username and password in base 64 encoded format after the word ‘Basic’ - you can decode it and use it for your use case. It will be in this format in Nodejs:
{ “authorizationToken": "Basic {{base 64 encoded username:password}}” }
For resource level troubleshooting, I would request you to raise a premium support case and a Support Engineer can look into the topic/subscription in question.
相关内容
- AWS 官方已更新 10 个月前
- AWS 官方已更新 4 个月前
- AWS 官方已更新 3 年前