尝试通过 REST Api 访问我的 Windows Azure 存储帐户时,我遇到了身份验证问题。
我已阅读以下资源以确定如何生成请求:
http://msdn.microsoft.com/en-us/library/windowsazure/dd179428.aspx
http://convective.wordpress.com/2010/08/18/examples-of-the-windows-azure-storage-services-rest-api/
Azure Blob 服务 REST API 返回 403 错误:“未指定请求日期标头”
据我了解,请求中只有 4 个变量:确定服务端点的实际 URI,GMT 时间的当前日期主访问密钥帐户名称。
我的前两个来自 MSDN 资源,另外两个来自我的 Windows Azure 门户。
GET http://<account_name>.table.core.windows.net/ HTTP/1.1 x-ms-date: Sun, 24 Feb 2013 09:19:31 GMT x-ms-version: 2009-09-19 Authorization: SharedKey <account_name>:<primary_key> Accept-Charset: UTF-8 Accept: application/atom+xml,application/xml DataServiceVersion: 1.0;NetFx MaxDataServiceVersion: 1.0;NetFx Host: <account_name>.table.core.windows.net
我检查以确保帐户名称和主键正确,并且根据另一篇帖子的建议,x-ms-date 时间戳在 15 分钟内。
我收到以下回复:
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: 437
Content-Type: application/xml
Server: Microsoft-HTTPAPI/2.0
x-ms-request-id: d78c2c11-8699-4737-9592-82813eac356e
Date: Sun, 24 Feb 2013 21:20:03 GMT
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>AuthenticationFailed</code>
<message xml:lang="en-US">Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:d78c2c11-8699-4737-9592-82813eac356e
Time:2013-02-24T21:20:03.2036675Z</message>
</error>
有关修复正确身份验证请求的任何建议?
此外,我能够下载 Azure 存储资源管理器实用程序并以这种方式访问该服务,因此我知道存储帐户有效且正常工作。