Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InvalidRequest] The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256 #96

Open
damient opened this issue Nov 16, 2014 · 16 comments

Comments

@damient
Copy link

damient commented Nov 16, 2014

Hi,

I use the new location "Franckfurt" for my bucket and Amazon use the new signature version 4 only.

Can you adapt your code for this version ?

Thx.

@stuartford
Copy link

vote++. This would be very useful.

@fb3rasp
Copy link

fb3rasp commented Dec 16, 2014

vote++
Does anybody have a work around for now?

@MaiKaY
Copy link

MaiKaY commented Dec 17, 2014

vote++

@Luzifer
Copy link

Luzifer commented Dec 22, 2014

Someone would need to implement the new hashing algorithm described at http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html / http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html - Currently I didn't manage to do so…

@DavidAnderson684
Copy link

@boussou
Copy link

boussou commented Feb 20, 2015

@DavidAnderson684
Copy link

I actually started work on this, and got the signature in the header working. Then I spotted the requirement that if you use this signature, then there's also a requirement to sign the payload with a new hash too - and doing this for multipart uploads had another complicating factor as well.

At that point, I decided to instead switch to the official AWS PHP SDK as a better long-term option. I created a compatibility layer that was sufficient for the use-case of my code, but won't handle a lot of other scenarios - but it may be useful for others to consult if they decide to port over to the AWS SDK; it's here: http://plugins.svn.wordpress.org/updraftplus/trunk/includes/S3compat.php

@boussou
Copy link

boussou commented Feb 21, 2015

I found that when you create a bucket from this package, it work perfectly.
it end up in the region "US Standard" and then in this region AWS4-HMAC-SHA256 is pefectly accepted then a file uploads actually work.

When I use a bucket name created in the regions "Frankfurt" I got an error

@DavidAnderson684
Copy link

@bouusoou: Which package are you referring to as "this package" ? tpyo's class, or mine?

@boussou
Copy link

boussou commented Feb 21, 2015

tpyo's class.

I am a bit confused with yours and did not use it in the end, because tpyo's was.
(when region is "US Standard")

I think call should look like this:

$compat=new UpdraftPlus_S3_Compat;
$compat->setAuth($awsAccessKey, $awsSecretKey);
$compat-> setRegion($region);
$compat->putObjectFile($file, $bucket, $uri, $acl = self::ACL_PRIVATE)

@robertotremonti
Copy link

+1 on this

@Bakual
Copy link

Bakual commented Jun 23, 2015

Also run into this today. Using the official SDK kit is no option for me as it imho requires PHP 5.5 and my code has to run on PHP 5.3.10+.
As a workaround I just don't use the newer servers like Frankfurt, but it would be helpful if that is supported.

@DavidAnderson684
Copy link

"it imho requires PHP 5.5"

The 2.x branch of the official SDK is still maintained, and requires PHP 5.3.3+ : https://github.com/aws/aws-sdk-php/tree/2.8

@Bakual
Copy link

Bakual commented Jun 23, 2015

Thanks! Didn't know that.

@tpyo
Copy link
Owner

tpyo commented Jun 29, 2015

Sorry everyone, I haven't been able to look into this. Would anyone be willing to work on a PR?

@philicious
Copy link

philicious commented Jul 25, 2016

unfortunately I dont have the time to fix up the code and make a PR but I'd like to +1 this

Edit: now I saw there is PR #122 which looks quite promising on first glance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests