Amazon S3: Strange Error -' Sometimes' SignatureDoesNotMatch, sometimes it does

前端 未结 2 612
半阙折子戏
半阙折子戏 2021-02-06 07:36

I am developing code for salesforce. We are using \'Force.com for Amazon Web Services\' App from Appexchange. The app is provided by Amazon.

I am downloading files from

相关标签:
2条回答
  • 2021-02-06 08:08

    Are you using the Java SDK? Which version?

    A bug was introduced in version 1.4.4 I think, and has been fixed in the most recent releases. Once I upgraded to the buggy version, I had intermittent signature problems when using SQS, and I've seen a post on AWS Forums of some people reporting the exact same issue with DynamoDB. Now I upgraded to version 1.4.7 and the bug disappeared.

    Maybe you are seeing the same bug!

    0 讨论(0)
  • 2021-02-06 08:13

    Finally I was able to solve this problem, here is how?

    Sample URL for file on Amazon S3 is-

    http://adminportal.s3.amazonaws.com/sample.pdf?AWSAccessKeyId=AKIAIRUZSRRCVSLXZCIA&Expires=1372653478&Signature=RvMJ1gJL+qNKmnRkqzuytmlUTGQ=
    

    Here the Signature is generated by classes provided by Amazon.

    For unknown reasons, 'Force.com for Amazon Web Services' app was generating signature which contain SPACES.

    E.g. In the given URL, space is replaced by '+'.

    To get rid of the problem, just URL encode the signature. Encoding will replace spaces with special character and problem will be resolved.

    0 讨论(0)
提交回复
热议问题