I am developing code for salesforce. We use the Force.com for Amazon Web Services app from Appexchange. Application provided by Amazon.
I am downloading files from Amazon S3 on a machine.
Sometimes I get the error below. Interestingly, only sometimes I get this error, the rest of the time that it works, even for the same file.
<Error> <Code>SignatureDoesNotMatch</Code> <Message> The request signature we calculated does not match the signature you provided. Check your key and signing method. </Message>
I tried using both URL patterns provided by Amazon. It expires 1 hour after the link is generated; therefore, this may not be a problem.
URL1:- http://adminportal.s3.amazonaws.com/sample.pdf?AWSAccessKeyId=AKIAIRUZSRRCVSLXZCIA&Expires=1372653478&Signature=RvMJ1gJL+qNKmnRkqzuytmlUTGQ= URL2:- http://s3.amazonaws.com/adminportal/sample.pdf?AWSAccessKeyId=AKIAIRUZSRRCVSLXZCIA&Expires=1372658253&Signature=%2FmI0m0PTlHJpJ%2FP5d%2FX3OApqzcI%3D
The signature is generated by the class provided by Amazon, I think it should work well all the time.
Can someone clarify why S3 can give this error only sometimes?
Ganesh bhosle
source share