FineUploader / server-examples

Server-side examples for the Fine Uploader library
https://fineuploader.com
MIT License
279 stars 204 forks source link

Getting 403 because of signature doesn't match #69

Closed dhanababum closed 6 years ago

dhanababum commented 6 years ago

Hi, I am using fineuploader to uploade multiple images to S3, But I am getting an issue Signature doesn't match. And I found amazon s3 using version 4 for signature http://docs.aws.amazon.com/AmazonS3/latest/API/images/sigV4-post.png

Amazon s3 people given an example for version 4 http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html. So I tried this example to regenerate exact same signature what they have already, But I am unable to regenerate it.

I have used django example from this repo, but this example outdated, And I solved many issues. Finally I stuck with Signature mismatch.

Code:


DateKey = hmac.new(b'AWS4'+b'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', b'20151229', hashlib.sha256).digest()

DateRegionKey = hmac.new(DateKey, b'us-east-1', hashlib.sha256).digest()

DateRegionServiceKey = hmac.new(DateRegionKey, b's3', hashlib.sha256).digest()

SigningKey = hmac.new(DateRegionServiceKey, b'aws4_request', hashlib.sha256).digest()

signature = hmac.new(policy, SigningKey, hashlib.sha256).digest()

binascii.hexlify(signature)

Please help me

rnicholus commented 6 years ago

seems close enough to be a duplicate of #51