0

I'd like to ask if there's any error in my canonical request, im trying to create one to the AWS Secrets Manager taking the sample request by example.

Doc:https://docs.aws.amazon.com/pt_br/AmazonS3/latest/API/sig-v4-header-based-auth.html

Sample Request: `POST / HTTP/1.1 Host: secretsmanager.region.domain Accept-Encoding: identity X-Amz-Target: secretsmanager.GetSecretValue Content-Type: application/x-amz-json-1.1 User-Agent: X-Amz-Date: Authorization: AWS4-HMAC-SHA256 Credential=,SignedHeaders=, Signature= Content-Length:

{ "SecretId": "MyTestDatabaseSecret", }`

My Canonical Request: `POST /GetSecretValue

accept-encoding:identity content-type:application/x-amz-json-1.1 host:secretsmanager.sa-east-1.amazonaws.com x-amz-content-sha256:beaead3198f7da1e70d03ab969765e0821b24fc913697e929e726aeaebf0eba3 x-amz-date:20230111T145646Z x-amz-target:secretsmanager.getsecretvalue

accept-encoding;content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target beaead3198f7da1e70d03ab969765e0821b24fc913697e929e726aeaebf0eba3`

I did the changes that the documentation was asking, but when i try to recreate the signature by the postman, well, It gets wrong.

  • How did you create the signature? – jellycsc Jan 11 '23 at 17:32
  • Hello, i created the request by using a python code and adapting to the params my request needs, and I can't use any aws-sdks because of the limitations of my project. So, i'm trying to replicate the signature and convert it to Microsoft Power Automate. Python code used:[github](https://github.com/jvictorcorreia/canon_request/blob/main/canonical_request.py) – knowledge_eater Jan 11 '23 at 17:48
  • But i didnt created the signature, first i'm trying to create the canonical request to calculate the signature. – knowledge_eater Jan 11 '23 at 17:49
  • but I created the signature of the example used in the documentation with the Code: [AWS Signature github](https://github.com/jvictorcorreia/canon_request/blob/main/aws_signature.py) – knowledge_eater Jan 11 '23 at 17:55

0 Answers0