gpt4 book ai didi

rest - 在 HTTP 请求 '...' 中找到的 MAC 签名与任何计算签名都不相同

转载 作者:行者123 更新时间:2023-12-04 00:52:16 25 4
gpt4 key购买 nike

我正在 Postman 中发送以下请求,以从位于此 URL https://steamo.blob.core.windows.net/testcontainer/dog.jpg 的 Azure Blob 存储中检索一个简单的 .jpg

GET /testcontainer/dog.jpg HTTP/1.1
Host: steamo.blob.core.windows.net
Authorization: SharedKey steamo:<my access key>
x-ms-date: Tue, 26 May 2015 17:35:00 GMT
x-ms-version: 2014-02-14
Cache-Control: no-cache
Postman-Token: b1134f8a-1a03-152c-2810-9cb351efb9ce

如果您不熟悉 Postman,它只是一个 REST 客户端 - Postman-Token header 可能会被忽略。

我的访问 key 是从我的 Azure 管理门户复制的。

我收到此错误:
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:2482503d-0001-0033-60da-9708ed000000 Time:2015-05-26T17:35:41.4577821Z

有了这个 AutheticationErrorDetail:
The MAC signature found in the HTTP request '<my access key>' is not the same as any computed signature. Server used following string to sign: 'GET x-ms-date:Tue, 26 May 2015 17:35:00 GMT x-ms-version:2014-02-14 /steamo/testcontainer/dog.jpg'.

我该如何解决?如果您需要我提供更多信息,请告诉我。

最佳答案

Azure 存储的身份验证不仅仅是提供访问 key 的问题(这不是很安全)。您需要创建一个代表给定请求的签名字符串,使用 HMAC-SHA256 算法对字符串进行签名(使用您的存储 key 进行签名),并将结果编码为 base 64。参见 https://msdn.microsoft.com/en-us/library/azure/dd179428.aspx有关完整的详细信息,包括如何构造签名字符串。

关于rest - 在 HTTP 请求 '...' 中找到的 MAC 签名与任何计算签名都不相同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30465420/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com