斑点上传未经授权的服务器无法验证请求例外 [英] Blob upload unauthorized Server failed to authenticate the request exception

查看:206
本文介绍了斑点上传未经授权的服务器无法验证请求例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前用这个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屋!

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