phoet / asin

:books: :package: Amazon Simple INterface - Support for ItemLookup, SimilarityLookup, Search, BrowseNode and Cart Operations
http://asin.herokuapp.com/
167 stars 59 forks source link

SignatureDoesNotMatch #50

Closed ReinierKorth closed 7 years ago

ReinierKorth commented 7 years ago

Hi,

I've been using the asin gem for months without any problems but now all of a sudden I get these errors on all my api calls:

SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.eb0458ea-0d4c-42ea-bd0b-4ba3b8eddc79' These are the params I'm sending: D, [2017-08-01T13:34:02.116024 #9058] DEBUG -- : calling with params={:Keywords=>"pampers baby dry 2 22", :SearchIndex=>"Baby", :Operation=>:ItemSearch} I, [2017-08-01T13:34:02.116742 #9058] INFO -- : performing rest call to url='http://webservices.amazon.de/onca/xml?AWSAccessKeyId=AKIAJMVM7ENHSE65I23Q&AssociateTag=i0616-21&Keywords=pampers%20baby%20dry%202%2022&Operation=ItemSearch&SearchIndex=Baby&Service=AWSECommerceService&Timestamp=2017-08-01T11%3A34%3A02Z&Version=2011-08-01&Signature=9zSE%2BHIFFqYR5PUnOHf%2Fpwmb3NtShIB5y8zevGhtccw%3D' I didn't change anything (I think) and I've made several new access key id's and they all give the same error. I think it has to do with the %2B (+) and %3D (=) in the signature which must be some kind of character encoding thingy going wrong... Thnx! Reinier
phoet commented 7 years ago

what version of ruby are you running this on?

ReinierKorth commented 7 years ago

2.3.1p112 locally and 2.3.4p301 on production

phoet commented 7 years ago

unfortunately i can't be of great help here. since amazon changed the reseller structure, i can not access the account any longer.

from what i see in the vcr cassettes, the urls indeed looked like they did not have plus and equals encoded http://webservices.amazon.com/onca/xml?AWSAccessKeyId=AKIAIBNLWSCV5OXMPD6A&AssociateTag=phoet-20&BrowseNodeId=599826&Operation=BrowseNodeLookup&ResponseGroup=BrowseNodeInfo&Service=AWSECommerceService&Signature=UB+NuD8bReMd+8UFaQva+uJiYYsM6uefMtPTVysD2dU=&Timestamp=2012-09-25T20:04:51Z&Version=2011-08-01

this line would be responsible in case there is something broken https://github.com/phoet/asin/blob/master/lib/asin/client.rb#L287

would you like to take a stab at fixing this?

ReinierKorth commented 7 years ago

Yeah I was already looking at that line.

I will give it a go. First need to figure out how to contribute to a gem :)

phoet commented 7 years ago

nowadays a good project should have a section on contribution, this one is a bit old, so there is none unfortunately.

phoet commented 7 years ago

if you have any questions feel free to ask here

phoet commented 7 years ago

i finally came around to create myself another account for testing purposes. i did not see any errors related to signature-mismatches. so i can't really help you out here.

my current WIP can be found here: https://github.com/phoet/asin/pull/51