This article is frustratingly vague. For example it suggests to "check the secret access key" but gives zero information on how to do that.
The vagueness of "Make sure that the HTTP headers that you use to generate the signature match the headers that the client sends to S3 in the HTTP request"... okay there are about 16 headers in each request, which ones SPECIFICALLY are you validating? I've tried 439 different combinations and I REPEATEDLY get the SignatureDoesNotMatch error. Oh yeah, and the boto client throws an error when I add the ContentType param to the generate_presigned_url request.
I had the same issue, because i'm adding content-type while generating a pre-signed-url:-
upload_url = s3_client.generate_presigned_url(
'put_object',
Params={
'Bucket': BUCKET_NAME,
'Key': key,
'ContentType': 'video/mp4' # Adjust based on your needs
},
ExpiresIn=3600)
but while using the pre-signed-url in postman, it doesn't send the content-type sometimes like below:-
PUT https://vids-mumbai.s3.amazonaws.com/video-songs/hukum?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AK5678HS4567jhuuiY5UBGY2NY%2F20250607%2Fap-west-1%2Fs3%2Faws4_request&X-Amz-Date=20250607T063320Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Signature=65789hjkkj,mhnhgbk,mdfdfvv
Request Headers
User-Agent: PostmanRuntime/7.44.0
Accept: */*
Cache-Control: no-cache
Postman-Token: 4522edd7-53e9-42cd-bf13-288e6ed3b1ff
Host: vids-mumbai.s3.amazonaws.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
but when i manually added the content-type to the headers it worked fine for me
Relevant content
- asked a year ago
- asked 10 months ago
- asked 10 months ago
