Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php `SignatureDesNotMatch` Alexa顶级网站服务AWS的响应_Php_Api_Amazon Web Services_Cryptography_Alexa - Fatal编程技术网

Php `SignatureDesNotMatch` Alexa顶级网站服务AWS的响应

Php `SignatureDesNotMatch` Alexa顶级网站服务AWS的响应,php,api,amazon-web-services,cryptography,alexa,Php,Api,Amazon Web Services,Cryptography,Alexa,我是指和使用。我收到以下signaturedesnotmatch错误: <?xml version="1.0"?> <Response><Errors><Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Che

我是指和使用。我收到以下
signaturedesnotmatch
错误:

<?xml version="1.0"?>
<Response><Errors><Error><Code>SignatureDoesNotMatch</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><RequestID>28c6b028-c4b6-66a2-f5d8-70d8dc21b8f8</RequestID>
</Response>
我对同一个用户尝试了两个不同的访问密钥,并注册了Alexa Web信息服务,但没有成功。我在Mac OS 10.9和10.10上尝试了这些脚本,我的时间设置被设置为自动更新

在PHP代码中,这是生成签名的部分:

/**
 * Generates a signature per RFC 2104
 *
 * @param String $queryParams query parameters to use in creating signature
 * @return String             signature
 */
protected function generateSignature($queryParams) {
    $sign = "GET\n" . strtolower(self::$ServiceHost) . "\n/\n". $queryParams;
    echo "String to sign: \n" . $sign . "\n\n";
    $sig = base64_encode(hash_hmac('sha256', $sign, $this->secretAccessKey, true));
    return rawurlencode($sig);
}

我不确定我做错了什么

我知道了。根AWS用户可以发出请求,但我创建的IAM用户不能。我猜root用户可以访问Alexa服务,但不能访问IAM用户。

感谢您的回复,您应该能够在一段时间后接受自己的答案……您是否已经确定是否可以使用非root用户?目前,您似乎仍然需要使用root密钥。我也不能让我工作。喝倒采切换到标签,没有MAC标签,签名用于方法签名。