Skip to content

Put request to S3 pre-signed URL is failing from POstman

0

I am making PUT request to S3 pre-signed URL from Postman but I am getting 403 error.

curl --location --request PUT 'https://aishwary-test-14sep.s3.us-east-1.amazonaws.com/json_out_test.json?response-content-disposition=inline&X-Amz-Security-Token=<Token>&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240916T030822Z&X-Amz-SignedHeaders=host&X-Amz-Expires=21600&X-Amz-Credential=<Creds>&X-Amz-Signature=<Signature>'
--header 'Content-Type: application/json'
--data '{"hzDocFragment":""}'

Response I am getting is

<?xml version="1.0" encoding="UTF-8"?> <Error> <Code>SignatureDoesNotMatch</Code> <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message> <AWSAccessKeyId>...</AWSAccessKeyId> <StringToSign>AWS4-HMAC-SHA256 20240916T030822Z 20240916/us-east-1/s3/aws4_request 6684cccf3857806dfc32eaa9a11bf1323a3894a79b823b129e9acc41d6be8160</StringToSign> <SignatureProvided>7ec7619a2690fd374326f3bd6b8f6d2117cf2577bab9a63dc869064d329c0348</SignatureProvided> <StringToSignBytes>41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 32 34 30 39 31 36 54 30 33 30 38 32 32 5a 0a 32 30 32 34 30 39 31 36 2f 75 73 2d 65 61 73 74 2d 31 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 36 36 38 34 63 63 63 66 33 38 35 37 38 30 36 64 66 63 33 32 65 61 61 39 61 31 31 62 66 31 33 32 33 61 33 38 39 34 61 37 39 62 38 32 33 62 31 32 39 65 39 61 63 63 34 31 64 36 62 65 38 31 36 30</StringToSignBytes> <CanonicalRequest>PUT /json_out_test.json X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=ASIA2LFKRV57RY3EK2L2%2F20240916%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20240916T030822Z&amp;X-Amz-Expires=21600&amp;X-Amz-Security-Token=<Token>&amp;X-Amz-SignedHeaders=host&amp;response-content-disposition=inline host:aishwary-test-14sep.s3.us-east-1.amazonaws.com

host UNSIGNED-PAYLOAD</CanonicalRequest> <CanonicalRequestBytes>....</CanonicalRequestBytes> <RequestId>1HHGFY05Y1AHZK5W</RequestId> <HostId>ABwGc1Ju0RljOpu8fHOUrfYbeAmEmEXehGiXgxcxU/AsXssPIkXX7lIZ5adH33WYygBYyYL1qcY=</HostId> </Error>

asked a year ago636 views
1 Answer
1

Hello.

How do you issue pre-signed URLs?
A 403 error will occur if the request and signature do not match exactly as shown in the stackoverflow answer below.
In other words, you need to check not only the request parameters but also how to create the pre-signed URL.
https://stackoverflow.com/questions/46869962/getting-403-forbidden-when-uploading-to-s3-with-a-signed-url

EXPERT
answered a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago
  • I copied the pre-signed URL from the UI console.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.