Blob upload unauthorized Server failed to authenticate the request exception

↘锁芯ラ 提交于 2019-12-13 20:33:46

问题


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 });

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.

I copied their code and it's still the same. I'm all out of ideas.


回答1:


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.



来源:https://stackoverflow.com/questions/15874847/blob-upload-unauthorized-server-failed-to-authenticate-the-request-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!