Azure列表blob操作失败,错误403" AuthenticationError"

时间:2016-02-25 14:40:42

标签: c++ rest azure curl

我们正在开发使用Azure存储服务存储数据的产品。

我们通过C ++使用Azure REST API与Azure进行通信。我们正在使用cURL来执行REST请求。

现在,我们正在研究列出blob的功能,但它失败并出现错误

<?xml version="1.0" encoding="utf-8"?>
<Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate
 the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:16cd7e3d-0001-0032-2dd6-6f2e4f000000
Time:2016-02-25T14:14:23.2377982Z</Message><AuthenticationErrorDetail>The MAC signature found in the HTTP request 'CyPhz
sBdBCRRg2w157IYY4sIB23XwzKsfdAaUTVCAts=' is not the same as any computed signature. Server used following string to sign
: 'GET











x-ms-date:Thu, 25 Feb 2016 14:16:20 GMT
x-ms-version:2015-02-21
/sevenstars/container2
comp:list
delimiter:/
maxresults:2
restype:container'
</AuthenticationErrorDetail></Error>

====================== 以下是我们观察到的wireshark输出

GET /container2?comp=list&delimiter=/&maxresults=2&restype=container HTTP/1.1
Host: sevenstars.blob.core.windows.net
Accept: */*
x-ms-date:Thu, 25 Feb 2016 14:16:20 GMT
x-ms-version:2015-02-21
Authorization:SharedKey sevenstars:CyPhzsBdBCRRg2w157IYY4sIB23XwzKsfdAaUTVCAts=

HTTP/1.1 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Content-Length: 704
Content-Type: application/xml
Server: Microsoft-HTTPAPI/2.0
x-ms-request-id: 16cd7e3d-0001-0032-2dd6-6f2e4f000000
Date: Thu, 25 Feb 2016 14:14:22 GMT

...<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:16cd7e3d-0001-0032-2dd6-6f2e4f000000
Time:2016-02-25T14:14:23.2377982Z</Message><AuthenticationErrorDetail>The MAC signature found in the HTTP request 'CyPhzsBdBCRRg2w157IYY4sIB23XwzKsfdAaUTVCAts=' is not the same as any computed signature. Server used following string to sign: 'GET

======================

根据微软论坛的建议。我确保所有参数都设置正确。 (:用于代替字符串中的=来签名)

您能告诉我们我们如何解决这个问题? 非常感谢您的帮助。

谢谢和问候 Rahul Naik

0 个答案:

没有答案