斑点上传未经授权的服务器无法验证请求例外 [英] Blob upload unauthorized Server failed to authenticate the request exception
问题描述
我以前用这个code一个星期,一切都很好。我的同事仍在使用完全相同的code和他们一点问题都没有。
I used this code a week ago and everything was fine. My colleagues are still using the exact same code and they have no problem at all.
StorageCredentialsAccountAndKey heronStorage = new StorageCredentialsAccountAndKey("heron", "someKey");
CloudBlobClient blobClient = new CloudBlobClient("someUrl", heronStorage);
CloudBlobContainer container = blobClient.GetContainerReference("containerName");
container.CreateIfNotExist();
container.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob });
这code抛出:服务器无法进行身份验证的要求确保授权头的值是正确形成,包括签名。
在 container.CreateIfNotExist();
行。
This code throws:"Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature."
at container.CreateIfNotExist();
line.
我复制他们的code,它仍然是相同的。我所有的想法。
I copied their code and it's still the same. I'm all out of ideas.
推荐答案
请确保您的系统时钟正确同步,错误的时区和不当的同步导致哈希失败。作为服务器使用时间同步来验证请求的一部分。
Make sure your system clock is properly synchronized, wrong time zone and improper synchronization causes hashes to fail. As servers use time as part of synchronization to validate requests.
这篇关于斑点上传未经授权的服务器无法验证请求例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!