The authorization mechanism you have provided is not supported...

0

Trying to add S3 support to one of our systems. I'm not able to use one of your SDK so I'm doing this through just regular POST processing. I've built up my web page and thought I had it right but I keep getting this error and can't get past it. This is what I'm getting back from amazon web server. (btw... I hope I have all the terminology straight...)

Content-Disposition: form-data; name="X-Amz-Credential"

<key stuff>/20190814/us-east-2/S3/awss4_request
---httpapi-2019-08-14-10.50.29.595
Content-Disposition: form-data; name="AWSAccessKeyId"

<Key stuff> ---httpapi-2019-08-14-10.50.29.595 Content-Disposition: form-data; name="x-amz-date"

20190814T105029Z
---httpapi-2019-08-14-10.50.29.595
Content-Disposition: form-data; name="x-amz-algorithm"

aws4-hmac-sha256
---httpapi-2019-08-14-10.50.29.595
Content-Disposition: form-data; name="key"

user/user1/${filename}
---httpapi-2019-08-14-10.50.29.595
Content-Disposition: form-data; name="acl"

public-read
---httpapi-2019-08-14-10.50.29.595
Content-Disposition: form-data; name="Policy"

<policy file> ---httpapi-2019-08-14-10.50.29.595 Content-Disposition: form-data; name="X-Amz-Signature" <signature>

---httpapi-2019-08-14-10.50.29.595
Content-Disposition: form-data; name="Signature"
<signature>

---httpapi-2019-08-14-10.50.29.595
Content-Disposition: form-data; name="file"; filename="/xxx/xxxx.pdf "
Content-Type: application/octet-stream
<file info>

I get the following message.
<Error><Code>InvalidRequest</Code><Message>The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.</Message><RequestId>497D50731822C357</RequestId><HostId>bRNPX3JjV1H3TaS0IFiMi36Mod3V0dzkz6HTUTuK92gExdryRLkOEKkIA+fVZpV/tMkUu/ixWPg=</HostId></Error>

I've tried using AWS4-HMAC-SHA256 in both caps and lower case. All the searches I've done point to old posts that are not relevant. Is there anything else that could be causing this error to be thrown?

warped6
已提問 5 年前檢視次數 1817 次
3 個答案
0

Hi,
Not sure if this was a typo in your post, or possibly related to the issue..

/20190814/us-east-2/S3/awss4_request

"awss4"_request should be "aws4_request"

/20190814/us-east-2/S3/aws4_request

Hope this helps!
-randy

已回答 5 年前
0

Turns out it was the extra blank lines between the various sections but you are right about the AWSS4 bit! Thanks for that catch. Now onto my next problem.

warped6
已回答 5 年前
0

Turns out AWS didn't like the extra blank lines between sections.

warped6
已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南