aws Signature is not validating in amazon api

自古美人都是妖i 提交于 2019-12-12 04:47:19

问题


I have generated the aws signature using the code.

function getSignatureKey(key, dateStamp, regionName, serviceName) {
    var kDate= lCase(HMAC(ARGUMENTS.dateStamp,"AWS4" & ARGUMENTS.key,"hmacsha256"));
    var kRegion= lCase(HMAC(ARGUMENTS.regionName,binaryDecode(kDate,'hex'),"hmacsha256"));
    var kService=lCase(HMAC(ARGUMENTS.serviceName,binaryDecode(kRegion,'hex'),"hmacsha256"));
    var kSigning= lCase(HMAC("aws4_request",binaryDecode(kService,'hex'),"hmacsha256"));

    return kSigning;
}

<cfset signature = getSignatureKey("fdsaadsf87324hdsfo4324d324", "20170504", "us-west-2", "AWSECommerceService")> 

but when i call the api and dump the response it says that "The request signature we calculated does not match the signature you provided"

I am following this link my How to derive a sign-in key for AWS Signature Version 4 (in ColdFusion)? my result is matching with their result when i put their values. But when i put original values of my own account it does not match.

来源:https://stackoverflow.com/questions/43786964/aws-signature-is-not-validating-in-amazon-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!