【问题标题】:Authorization against Azure Storage Emulator using postman?使用邮递员对 Azure 存储模拟器进行授权?
【发布时间】:2019-12-07 04:18:25
【问题描述】:

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

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

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

<?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>.

这是 Authorization 标头的键值对:

关于如何解决这个问题的任何想法?我遵循了文档,但没有运气。

【问题讨论】:

    标签: azure rest http-headers postman azure-storage-emulator


    【解决方案1】:

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

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

    当您不使用 SAS 时,授权标头就会出现。我注意到您只是将帐户密钥作为授权标头的一部分传递。那是行不通的。您实际上需要计算授权标头。更多详情请查看此链接:https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-29
      • 1970-01-01
      • 2021-06-24
      • 1970-01-01
      • 1970-01-01
      • 2019-05-09
      • 2019-07-16
      • 1970-01-01
      相关资源
      最近更新 更多