AWS SNS SES notifications to basic-auth HTTPS endpoint always sent twice

1

I have a setup to receive AWS SES Open notifications via SNS to a HTTPS endpoint of our web app. I followed the documentation and set it up with basic-auth https://docs.aws.amazon.com/sns/latest/dg/sns-http-https-endpoint-as-subscriber.html.

All notifications from AWS arrive two times, the first time without the basic-auth header, but full payload, and the second time with basic-auth header. Here a redacted dump of what AWS sends and how we respond when I open an email with tracking pixel https://gist.github.com/mklinik/29de83fe88a5c873db9b232a6f752760

Is this the expected behaviour?

1개 답변
1

Maybe someone else can answer the SES-specific implementation details pertaining to your question, so take my following answer with a grain of salt.

Basic auth is a challenge-response mechanism, so it is generally considered best practice to only send credentials when prompted. This allows for redirects to occur for example (e.g. upgrade the connection to HTTPS if initiated over HTTP), so the credentials only being sent when necessary.

AWS
Jesse_T
답변함 2년 전
  • Would be really handy if SNS could do preemptive authentication, like most http clients support. Would save both sides from duplicate requests.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠