0

Due to our system complexity, we chose to follow the hard way of calculating the signature for AWS API instead of using AWS SDK. Below, 3 different ways for sending a request to Amazon STS to assume a role.

  1. First, I used Postman to simulate the request and I got the desired response.
  2. After that, i used the Python script from the AWS Docs to calculate the signature and send the request. It also succeeded.
  3. Finally, using the same Amz-Date and same credentials to calculate the signature through a VB.NET script, i got this SignatureDoesNotMatch error after sending the request ( HttpWebRequest ).

I can see that the calculated signatures in Python Script and .NET are exactly the same if I use a specific datetime! But when I send it from python requests it works, when I send it from .NET HttpWebRequest it fails. Amazon calculates a different signature when I send it from Python and when I send it from .NET .

I guess that some headers are added to my .NET request that Amazon uses and calculates a different signature than mine? Any other idea?

DoesNotMatchSignatureError

kostas210
  • 23
  • 4
  • `Due to our system complexity,` - what prevents you? – Ermiya Eskandary Apr 29 '22 at 09:57
  • Also, welcome to Stack Overflow. [Please don't post screenshots of text](https://meta.stackoverflow.com/a/285557/4800344). They can't be searched or copied, or even consumed by users of adaptive technologies like screen readers. Instead, paste the code as text directly into your question. If you select it and click the `{}` button or press Ctrl+K, the code block will be indented by four spaces, which will cause it to be rendered as code. – Ermiya Eskandary Apr 29 '22 at 09:58
  • Can you also add your Python & .NET code to the question please? I recommend [taking the tour](https://stackoverflow.com/tour), as well as reading [how to ask a good question](https://stackoverflow.com/help/how-to-ask) and [what's on topic](https://stackoverflow.com/help/on-topic). – Ermiya Eskandary Apr 29 '22 at 09:59

0 Answers0