admin管理员组

文章数量:1336145

I am trying to get AWS secrets via API in uipath and I am not sure if the format of my canonical request is correct. I am getting this error:

{
"__type":"InvalidSignatureException",
"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."
}

Below is my canonical request:

POST
/
 
content-type:application/x-amz-json-1.1
host:secretsmanager.ap-southeast-2.amazonaws
x-amz-content-sha256:{hashed_payload}
x-amz-date:{timestamp}
x-amz-target:secretsmanager.GetSecretValue
 
content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target
{hashed_payload}

This is my string to sign:

AWS4-HMAC-SHA256
{timestamp}
{YYYYMMDD}/{region}/secretsmanager/aws4_request
{hashedCanonicalRequest}

This is my authorization header:

AWS4-HMAC-SHA256 Credential={accesskey}/{YYYYMMDD}/{region}/secretsmanager/aws4_request,SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,Signature={aws_signature}

I pass along same arguments in the authorization to the headers in my POST request. I can get correct hash output with my code using the samples from AWS documentation. Can someone please check where did it go wrong? Thank you!

本文标签: amazon web servicesAWS Secret Manager API Canonical RequestStack Overflow