'AWS SNS API4 authentication fails

I'm stuck around the production of the signature to perform an AWS SNS post, to be honest, I'm going for my 4th day of searching and trying:/

I found this AWS web site: https://docs.aws.amazon.com/pt_br/general/latest/gr/sigv4-signed-request-examples.html which has a python code that shows the entire process but, when I copy, paste change to my credentials/values the message below is exhibited:

RESPONSE++++++++++++++++++++++++++++++++++++
Response code: 403

<ErrorResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
  <Error>
    <Type>Sender</Type>
    <Code>SignatureDoesNotMatch</Code>
    <Message>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.</Message>
  </Error>
  <RequestId>7exxxx74-xxxx-xxxx-xxxx-e62e5xxxx9b</RequestId>
</ErrorResponse>

But sure, I'm working over this code in the last 3 days... change and altering the parameters but unsuccessfully.

So, the Postman application has the same authentication method that we are trying to use and, when the credentials are passed/put into the Postman the process works fine and we can get the outcome of signature in other words, the encrypted key. Compering both values (my and Postman) off sure, they are completely different.

Please, I don't know if you guys have been through the same situation but, I really appreciate any tip/trick around this matter.

Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source