“认证格式不正确";设置Azure Blob服务属性(REST API)时 [英] "Authentication not in correct format" when setting Azure Blob Service Properties (REST API)

查看:134
本文介绍了“认证格式不正确";设置Azure Blob服务属性(REST API)时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过遵循这些说明.

这是我提出请求后收到的错误:

This is the error I receive after making my request:

400认证信息没有以正确的格式给出.检查授权标头的值

请求网址:

PUT https://[MyAccountName].blob.core.windows.net/?restype=service&comp=properties

请求标头:

x-ms-version: 2013-08-15
x-ms-date: Tue, 25 Feb 2014 13:02:00 GMT
Authorization: SharedKey
[MyAccountName]: [MyAccountKey]
Content-Length: 329
Host: [MyAccountName].blob.core.windows.net

请求正文:

<?xml version="1.0" encoding="utf-8"?>
<StorageServiceProperties>
    <Cors>   
          <CorsRule>
                <AllowedOrigins>http://www.example.com</AllowedOrigins>
                <AllowedMethods>GET</AllowedMethods>
                <ExposedHeaders>x-ms-meta-data*,x-ms-meta*</ExposedHeaders>
                <AllowedHeaders>x-ms-meta-target*,x-ms-meta*</AllowedHeaders>
                <MaxAgeInSeconds>200</MaxAgeInSeconds>
        </CorsRule>
    <Cors>
</StorageServiceProperties>

推荐答案

该请求的授权标头不完整.它需要包含身份验证方案,存储帐户名称和签名.例如;

The request has an incomplete Authorization header. It needs to contain the authentication scheme, storage account name, and signature. For example;

Authorization: SharedKey myaccount:Z1lTLDwtq5o1UYQluucdsXk6/iB7YxEu0m6VofAEkUE=

有关更多信息,请参见 Windows Azure存储服务的身份验证.另一方面,如果您使用Windows Azure存储客户端库之一,它将为您处理身份验证.有关.NET库,请参见我们的 NuGet程序包.

For more information, see Authentication for the Windows Azure Storage Services. On the other hand, if you use one of the Windows Azure Storage Client Libraries, it will handle the authentication for you. For .NET library, please see our NuGet package.

这篇关于“认证格式不正确";设置Azure Blob服务属性(REST API)时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆