使用邮递员授权 Azure 存储模拟器?

Authorization against Azure Storage Emulator using postman?

我正在尝试使用 Azure 存储模拟器的固定 account/key 用于 Azure 存储模拟器共享密钥身份验证来进行身份验证。

发送匿名请求时我得到了正确的响应

但是在添加授权时 Header 我得到:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
   <code>InvalidAuthenticationInfo</code>
   <message xml:lang="en-US">Authentication information is not given in the correct format. Check the value of Authorization header.
RequestId:6d2cc79e-6bce-451c-a6f0-f10e0876f640
Time:2019-07-29T19:22:48.6402756Z</message>
</error>.

这是授权 header 的 key-value 对:

知道如何解决这个问题吗?我遵循了文档,但没有运气。

考虑到您使用的是 Shared Access Signature (SAS) URL,您无需添加 Authorization header,因为授权信息已包含在您的 SAS URL 中(sig 你的一部分 URL).

您可能想要做的一件事是更改 Accept header 的值并将其值设置为 application/json;odata=fullmetadata.

授权 header 在您不使用 SAS 时出现。我注意到您只是将您的帐户密钥作为授权的一部分传递 header。那行不通的。您实际上需要计算授权 header。请参阅此 link 了解更多详情:https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key.