javascript - AWS SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided -
i getting response request amazon product api.
<?xml version="1.0"?> <itemsearcherrorresponse xmlns="http://ecs.amazonaws.com/doc/2011-08-01/"><error><code>signaturedoesnotmatch</code><message>the request signature calculated not match signature provided. check aws secret access key , signing method. consult service documentation details.</message></error><requestid>9aff7feb-7f9b-4efb-aece-b595b1b7b0e5</requestid></itemsearcherrorresponse>
in javascript, generating signature as:
var paramo = { service:'awsecommerceservice', operation:'itemsearch', awsaccesskeyid:accesskeyid, associatetag:associatetag, version:'2011-08-01', searchindex:'all', keywords:name, responsegroup:'itemattributes,offersummary', timestamp:timestamp }; var string='get\nwebservices.amazon.in\n/onca/xml\n'; console.log(string+$.param(paramo)); var hash = cryptojs.hmacsha256(string+$.param(paramo), secretaccesskey); var signature = cryptojs.enc.base64.stringify(hash);
Comments
Post a Comment