【问题标题】:Windows Azure Queue returns 403 ForbiddenWindows Azure 队列返回 403 Forbidden
【发布时间】:2014-06-15 15:30:26
【问题描述】:

使用以下代码(我已经混淆了实际凭据):

CloudStorageAccount cloudStorageAccount = new CloudStorageAccount(new StorageCredentials(username, key), true);
CloudQueueClient clnt = cloudStorageAccount.CreateCloudQueueClient();

string logQueueReference = "log2";
CloudQueue queue = clnt.GetQueueReference(logQueueReference);

queue.CreateIfNotExists();

生成以下请求:

HEAD /log2?comp=metadata&timeout=90 HTTP/1.1
x-ms-version: 2012-02-12
User-Agent: WA-Storage/2.0.6.0
x-ms-date: Tue, 29 Apr 2014 13:26:29 GMT
Authorization: SharedKey username:transformedkey
Host: username.queue.core.windows.net

并返回以下响应:

HTTP/1.1 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Transfer-Encoding: chunked
Server: Microsoft-HTTPAPI/2.0
x-ms-request-id: 0cc84a81-73e1-4a8c-bf16-098af2b21149
Date: Tue, 29 Apr 2014 15:26:29 GMT

我已经仔细检查了凭据。它们是从 manage.windowsazure.com 的对话框中复制粘贴的。我在这里错过了什么?

【问题讨论】:

    标签: azure message-queue


    【解决方案1】:

    虽然此 403 错误的最常见原因是帐户密钥不正确(因此我会要求您再次检查),但如果您的计算机上的时钟已关闭(也称为 clock skewness),也可能会出现此错误。请检查您计算机上的时钟,并确保它没有偏离太多。有关详细信息,请参阅此线程:403 error in production from WindowsAzure.Storage

    【讨论】:

    • 你明白了!我的时钟关闭了。我没想到在这个现代。嗯嗯。
    • 嗨,Mantri,“您计算机上的时钟已关闭”是什么意思?我将时区更改为美国中部,但仍然无法正常工作。你能告诉我这是什么吗?
    猜你喜欢
    • 2017-02-14
    • 2012-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多