The request signature we calculated does not match the signature you provid


#1

Hello,

We have a few accounts that we pull order data out of Amazon for. One of the accounts is returning the error :“The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method.” when we try to connect through our code or through the scratchpad. There are two differences we see in the setup of this one account. First, there is a “/” (slash) in the secret key and second, this particular account has both an Amazon Webstore as well as an Amazon Store hosted by Amazon. We were wondering if either of those differences may be causing the issue.

Here is the snippet we are sending in:

Action=ListOrders&SellerId=A21ASJL9EPBE5H&LastUpdatedAfter=1969-07-20T06%3A00%3A00.000Z&OrderStatus.Status.1=PartiallyShipped&OrderStatus.Status.2=Unshipped&MarketplaceId.Id.1=ATVPDKIKX0DER&AWSAccessKeyId=AKIAIFG6WV53H6XSFWCQ&Timestamp=2013-09-06T21%3A33%3A37.976Z&Version=2011-01-01&SignatureVersion=2&SignatureMethod=HmacSHA256&Signature=zW%2FMHTOfGB%2B59wHWwvMQm2Mx8SgBpUo%2FiwCU0GcKbPY%3D

Thank you for your help


#2

There are a few common reasons why people get a signature error.

  • The secret key or merchant key is entered incorrectly. There may be spaces around these values, or part of a secret key may be removed if a non-letter character was entered.
  • The parameters are entered out of alphabetical order in the API call.
  • Not all parameters were included when calculating the signature.

The answer partly depends on whether you are using existing software or creating new software. If you need more help, please contact MWS Support.


#3

Thanks Gary,

The Secret Key provided has a Non Letter character. Is there some special encoding we can do to account for this when we send in the value, or is it a lost cause and this key needs to be regenerated?

Thanks for the help.


#4

Secret keys can have ‘/’ … so that isn’t the issue.

  • Is there any extra white space maybe?
  • Are you including both Ids in the wrong place? “… second, this particular account has both an Amazon Webstore as well as an Amazon Store hosted by Amazon.”
  • Do they both use the same login and keys ?? I would assume so but throwing out stuff to see if anything sticks … lol.

#5

If that is the case than the issue is yours …

My SKey : IGYIMTA7W/6cNuJ5L7oXXXXXXXXXXXXXXXXXXXX

… which as you can see has a forward slash and I have no issues with my signature.
> Oddy, I just recently had to re-do my script as after three years of use I finally encountered a NextToken that had a ‘=’ in it and it was throwing off my script.
My guess is you’ve change something to encode the slash in the SKey ??


#6

I’m certain that it’s the ‘/’ in the secret key that is causing the problem as it’s used as an escape character in programming.

To get to the bottom of this you can echo the query being sent to Amazon in your script that generates an error, then with the same parameters entered into the scratchpad, compare the query sent there.

Oddy, I just recently had to re-do my script as after three years of use I finally encountered a NextToken that had a ‘=’ in it and it was throwing off my script.


#7

I have a ‘/’ in one of my secret keys too. It’s been so long I don’t remember if it initially caused me problems or not.

For canonicalizing I was exploding parameters and values on ‘=’ so I changed it and everything feeding it to ‘|=|’ so as long as I don’t get that sequence in a NextToken I’ll be fine << famous last words lol


#8

It just donned on me that you’re probably using PHP and declared the secret key variable with double quotes:

$secretKey = “blahblahblah”;

Instead of with single quotes:

$secretKey = ‘blahblahblah’;

and it is trying to interpret an escape sequence.


#9

OOOOOoooooohhhhhhhhhhh … good catch … maybe (!)

10 points to whomever get’s it right … lol

Edited by: Oneida Books on Sep 20, 2013 2:42 PM

PS - You WILL get the ‘=’ in a next token eventually …


#10

“PS - You WILL get the ‘=’ in a next token eventually …”

Yeah, I took care of that, I’m gambling I won’t get a ‘|=|’ sequence


closed #11