-
Notifications
You must be signed in to change notification settings - Fork 1.9k
FineUploader 5.9 S3 multipart version 4 Signature Mismatch - bucket Name #1582
Comments
If fixed that by changing the getCanonicalUri method ( applicable only for v4 and chunked uploads if I understand the code ) :
Now i'm searching how to make it dynamically read the actual bucket name. I encountred another similar problem with the host and corrected it with just providing the "host" in the objectProperties. |
There is a bug somewhere in the code (either yours or Fine Uploader's), but the issue is very specific to your setup. In other words, v4 signatures are certainly not broken for everyone. I suspect the fact that you have a key function is important to locating the source of this bug. Perhaps if you remove it, everything works as expected. That may be the path to follow in order to determine exactly what the bug is here, or if one exists. |
I removed the key function and changed it to the "uuid" value
Same problem :
Fineuploader -> AWS S3
Same if i change the key value to "filename" I had the same reasoning at the beginning but seems to be unrelated. And yes v4 signatures are not broken for everyone : i didn't found the same problem elsewhere. |
Then the next step is to determine exactly what is causing the issue in your situation, that is, that unique factor in your environment, code, or setup. Once we know that, it will be possible to address the issue. |
Closing this due to lack of activity for an extended period of time. I'd be happy to consider reopening if more information is provided. |
I'm having this EXACT problem, and can't figure out where to look for the solution. Is it possible for you to point me to code where the S3 object key to be uploaded is defined? FineUploader is using a different value for the request to the signing endpoint vs. the POST request to the S3 endpoint - specifically it is adding the bucket name to the object key when POSTing to S3. |
Hi, I'm hitting the same problem, and have done some debugging. Hopefully this will point you in the right direction for a fix. The problem seems to affect the "bucket in path" style endpoints, which are then only option when your bucket name contains dots, for example
It doesn't appear to make a difference whether I use a custom "key" function. In this case, for chunked uploads, the "string to sign" sent by Fine Uploader to my signing endpoint has the correct hostname (s3.eu-west-1.amazonaws.com), but the path is just the key, whereas the path in this case should include the bucket name, e.g.
getCanonicalRequest() in this case includes "method" followed by "end of URL" followed by "querystring". The endOfUrl is constrcuted as follows:
but if "end of URL" is meant to be "path", this should start with the bucketname, only if the AWS endpoint style doesn't include the bucketname in the hostname. Does this help? |
I ran into this problem as well, and its because we're using From AWS
Sent by fineuploader
|
And what with that approach
Should it work with host like that |
Type of issue
Bug
Uploader type
S3
Bug details
Fine Uploader version
5.9
Browsers where the bug is reproducible
Chrome Version 50.0.2661.102 (64-bit)
Operating systems where the bug is reproducible
OSX 10.10.3
Exact steps required to reproduce the issue
All of your Fine Uploader initialization JavaScript code
Detailed explanation of the problem
I get the following error from AWS :
SignatureDoesNotMatch
The request signature we calculated does not match the signature you provided. Check your key and signing method.After some investigation i found that signature does not match because :
1/ In the first request : the sign request ( fineuploader -> backend sign url ) the headers value is the following :
"AWS4-HMAC-SHA256↵20160607T123918Z↵20160607/eu-central-1/s3/aws4_request↵POST↵/0PbAIa/UqRA9a/7b8b152a-13da-4a1e-9ef6-1123289c517a.pdf↵uploads=↵host:s3-eu-central-1.amazonaws.com ........."
Note that after the POST the bucket name is not included
2/ In the third request : the upload request ( fineuploader -> POST to aws s3 ) i get the 403 error SignatureDoesNotMatch and in the details i can read that my canonical request is :
POST
/my-bucket-name/0PbAIa/UqRA9a/7b8b152a-13da-4a1e-9ef6-1123289c517a.pdf
uploads=
host:s3-eu-central-1.amazonaws.com
.......
=> The filename between the sign request and the upload request is different : in the upload request it contains the bucket name, but in the sign request it does not. So the signature is different between the two requests.
So how the key is passed by fineuploader to the sign endpoint ? is there a chance that in some conditions the bucket name is not passed ? what are these conditions ?
I can correct this by a workaround in the server side sign code ( derived from fineuploader php aws sign code and modified to fit on our project ) to include the bucket name in the file key but it does not seems to be the clean way to do it.
The text was updated successfully, but these errors were encountered: