I have never been able to get Rest APIs to completely work with AWS. The error messages I have seen have been about the time not being correct or the command not being recognized (e.g., list-users). I have verified the "version" was appropriate for the corresponding command with AWS's website documentation.
I am trying to use curl with Linux to list the users or instances in my AWS account. I have a problem when I run it. My current error, that I would like to focus on, is "request signatures calculated does not match the signature provided." I went through the process of creating a signature carefully. It wasn't that surprising that it did not work given the hours of trouble and the seemingly many potential pitfalls in the tedious task of creating a signature.
I used this link to generate the hexadecimal string for the signature: http://docs.aws.amazon.com/general/lates...les-python
Here is the code:
Within 10 minutes of posting, I did not have the opportunity to edit this post. The hyperlink that is on the first three paragraphs should be totally deleted. Can the moderators do this?
I am trying to use curl with Linux to list the users or instances in my AWS account. I have a problem when I run it. My current error, that I would like to focus on, is "request signatures calculated does not match the signature provided." I went through the process of creating a signature carefully. It wasn't that surprising that it did not work given the hours of trouble and the seemingly many potential pitfalls in the tedious task of creating a signature.
I used this link to generate the hexadecimal string for the signature: http://docs.aws.amazon.com/general/lates...les-python
Here is the code:
def sign(key, msg): return hmac.new(key, msg.encode("utf-8"), hashlib.sha256).digest() def getSignatureKey(key, dateStamp, regionName, serviceName): kDate = sign(("AWS4" + key).encode("utf-8"), dateStamp) kRegion = sign(kDate, regionName) kService = sign(kRegion, serviceName) kSigning = sign(kService, "aws4_request") return kSigningI analyzed the output of the signatureKey using a modification of the Python code in the above link. The result is a string that is not hexadecimal nor alphanumeric. The result is a combination of special non-alphabet, non-numeric symbols and very few alphabet letters. I tried to work around this problem by using import binascii and binascii.hexlify (to convert the garbled string into a hexadecimal). I was able to get a hexadecimal string from otherwise strictly adhering to the sample of Python code from the above link. I tend to think my signatureKey is not right because of this binascii work that I had to do. But what did I do wrong? How is that Python code in the link above supposed to calculate a hexadecimal signature? For me it create something very different.
Within 10 minutes of posting, I did not have the opportunity to edit this post. The hyperlink that is on the first three paragraphs should be totally deleted. Can the moderators do this?