Author Topic: Invalid Signature  (Read 1124 times)

azmerod

  • Regular
  • **
  • Posts: 5
Invalid Signature
« on: June 11, 2010, 07:54:53 PM »
I install AVH Amazon and got my Access Key and everything from Amazon but for some reason it's telling me that the generated signature is invalid.

Here's the URL generated from the code and the response from Amazon

Code: [Select]
http://ecs.amazonaws.com/onca/xml?
AWSAccessKeyId=XXXXXXXXXXXXXXXXXX&
IsIncludeUniversal=1&
IsOmitPurchasedItems=1&
ListId=EKZ7W1E8MXHB&ListType=WishList&
Operation=ListLookup&ProductPage=1&
ResponseGroup=ListFull&
Service=AWSECommerceService&
Sort=LastUpdated&
Timestamp=2010-06-11T23%3A50%3A43Z&Version=2009-10-01&
Signature=OpPApUlC9g4erwn%2FHaNPybvIZGnhhWQ694N%2F8hrxk5c%3D

Code: [Select]
<Errors>
<Error>
   <Code>AWS.InvalidParameterValue</Code>
   <Message>
      OpPApUlC9g4erwn/HaNPybvIZGnhhWQ694N/8hrxk5c= is not a valid value for Signature. Please change this value and retry your request.
   </Message>
</Error>
<Error>
   <Code>AWS.InvalidSignature</Code>
   <Message>
      The 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.
   </Message>
</Error>
</Errors>

Any reason why the signature would be generating incorrectly?

Keep in mind that I'm running this on a local server so I'm not sure if that would create any problems.

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Invalid Signature
« Reply #1 on: June 11, 2010, 08:47:26 PM »
Are you running php4 or php5?

It doesn't really matter you run it on a local server.
Peter van der Does
AVH Plugins developer

azmerod

  • Regular
  • **
  • Posts: 5
Re: Invalid Signature
« Reply #2 on: June 11, 2010, 08:52:34 PM »
I'm running php 5.

I even tried editing it to use the php4 sha function but it still returned the same error.

azmerod

  • Regular
  • **
  • Posts: 5
Re: Invalid Signature
« Reply #3 on: June 11, 2010, 09:59:33 PM »
Ok, here's something new. If I try to lookup by ASIN it works fine.

Code: [Select]
http://ecs.amazonaws.com/onca/xml?
AWSAccessKeyId=XXXXXXXXXXXXXXXXXXXXXXXXX&
AssociateTag=&
Condition=All&
IdType=ASIN&
ItemId=0399156496&
Operation=ItemLookup&
ResponseGroup=Medium&
Service=AWSECommerceService&
Timestamp=2010-06-12T01%3A40%3A12Z&
Version=2009-10-01&
Signature=njoWIZcbfk089GnfJk%2Bs3V2NkHtQ5IX%2FN3nOBYenjqg%3D

So any clue as to why is it only failing on the wishlists?

Unless there's some secret place where I get the wishlist ID I'm assuming it's the last part of the url http://www.amazon.com/wishlist/2PH4DCVSNO6DC ? Otherwise I have no clue why it would be failing since it works with ASIN just fine.

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Invalid Signature
« Reply #4 on: June 13, 2010, 04:50:06 PM »
You're right about the wishlist.
It doesn't make sense why it doesn't work for the Wishlist call. Both calls use the method for calculating and adding the Sinature value.
Peter van der Does
AVH Plugins developer

azmerod

  • Regular
  • **
  • Posts: 5
Re: Invalid Signature
« Reply #5 on: June 16, 2010, 08:55:26 PM »
Just to note, it wasn't actually working for the ASIN either I just thought it was.

After trying it on a live server though it seems to work just fine. Any reason why it wouldn't work on the dev site even though the set up is exactly the same?

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Invalid Signature
« Reply #6 on: June 17, 2010, 08:26:37 AM »
Is it the same secretkey?
I myself had it happen once that i had to renew my secretkey at Amazon and enter the new one in the plugin, not sure why that was.
Peter van der Does
AVH Plugins developer