403服务器在使用soapui获取Azure存储数据时无法验证请求

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了403服务器在使用soapui获取Azure存储数据时无法验证请求相关的知识,希望对你有一定的参考价值。

我正在尝试使用soapUI获取Azure存储表数据。在邮递员中这工作正常,但在soapUI中运行时发生错误。

邮递员使用的URL:

https://storagename.table.core.windows.net/tablename?$filter=CalUId%20eq%20'040000008200E00074C5B7101A82E0080000000030D26B53FE24D6010000000000000000100000005CC0FFC3A3676E4CB70214BB089618AE'&sv=2019-10-10&ss=t&srt=sco&sp=rl&se=2020-06-07T23:32:15Z&st=2020-05-07T15:32:15Z&spr=https&sig=nlrNa1GXTqQPOaKP3X3kDQ056S%2Bwq9Fl1Y%2BTS8A%2FAdQ%3D

SoapUI中的请求:

GET https://storagename.table.core.windows.net/tablename?%24filter=CalUId%2520eq%2520%27040000008200E00074C5B7101A82E0080000000030D26B53FE24D6010000000000000000100000005CC0FFC3A3676E4CB70214BB089618AE%27&sv=2019-10-10&ss=t&srt=sco&sp=rl&se=2020-06-07T23%3A32%3A15Z&st=2020-05-07T15%3A32%3A15Z&spr=https&sig=nlrNa1GXTqQPOaKP3X3kDQ056S%25%252Bwq9Fl1Y%25%252BTS8A%25%252FAdQ%25%253D&accept=text%2F*%3Bq%3D0.3%2C%20text%2Fhtml%3Bq%3D0.7%2C%20text%2Fhtml%3Blevel%3D1%2Ctext%2Fhtml%3Blevel%3D2%3Bq%3D0.4%2C%20*%2F*%3Bq%3D0.5 HTTP/1.1
Accept-Encoding: gzip,deflate
Host: storagename.table.core.windows.net
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

SoapUI中的错误响应:

HTTP/1.1 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Content-Length: 437
Content-Type: application/xml
Server: Microsoft-HTTPAPI/2.0
x-ms-request-id: f3375700-4002-0012-0c1d-25d9df000000
x-ms-error-code: AuthenticationFailed
Date: Fri, 08 May 2020 09:46:33 GMT

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
  <code>AuthenticationFailed</code>
  <message xml:lang="en-US">Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:a15bcaa7-a002-001a-5f0c-25c3d0000000
Time:2020-05-08T07:43:20.2731207Z</message>
</error>
答案

在请求中添加接受标头将解决此问题。

accept */*

以上是关于403服务器在使用soapui获取Azure存储数据时无法验证请求的主要内容,如果未能解决你的问题,请参考以下文章

Azure Blob 存储上传错误:(403)禁止

Azure 使用 REST api 和托管标识创建 blob 容器 - 403 错误

Azure 功能:访问存储帐户时出现 403 错误

无法以编程方式获取 Azure 存储帐户的密钥

从 APIM 策略获取 Azure 表存储实体

Azure 存储帐户 - 错误 403 被禁止