postman Amazon SP API - CreateDestination -“请求标头中缺少访问令牌,”尽管它应该是无授权操作,但仍出现错误

xpcnnkqh  于 2022-11-07  发布在  Postman
关注(0)|答案(1)|浏览(206)

我正在尝试创建SP API通知的目标。我已将权限策略更改为我的AWS队列以授予创建消息和读取消息属性权限。
我正在使用STS凭据对postman中的请求进行签名。此请求应该是一个无授权操作,因此理想情况下它不应该要求访问令牌。请帮助我了解我可能做错了什么。
Postman 请求:

POST /notifications/v1/destinations HTTP/1.1
Host: sellingpartnerapi-eu.amazon.com
X-Amz-Content-Sha256: beaead3198f7da1e70d03ab969765e0821b24fc913697e929e726aeaebf0eba3
X-Amz-Security-Token: FwoGZXIvYXdzEHMaDI8z8g0xqn42DSi0ISKoAXEp97wFc6YYdaSZ9txcAswRRsRjZ32d++T4APe/rLIL1rDfq9A2c2KYuLsF8+9F/N7brZarJQymqFnQ57JcGugxK6Npg5o/UQjNhvnI0EUAIqTptb/bXLXnmz7I2K2lhGKgV7PEkqAQlX/iYGI5RoNN0wK1QE3IY3T1miyRLF40PGNHt16WQaZPTXsMfG6OvaFuMa/ijchvnQ+3KP9Hs62vVZoxeC0G3ii7rtyYBjItb1Ltu7wcpzAXRO6W/BZWWqNN28V2ZS+e0qiYryYtgdnv0Ov9KBDBJFWKplxu
X-Amz-Date: 20220906T100237Z
Authorization: AWS4-HMAC-SHA256 Credential=ASIA4RJ32PS7YHU6JTGP/20220906/eu-west-1/execute-api/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=2c0c3727088ffa984f181c38c89afe305840cc0058cada48480c3103f5c544fa
Content-Type: application/json
Content-Length: 170

{
  "name": "SaralDestination",
  "resourceSpecification":
  {
    "sqs":
    {
      "arn": "arn:aws:sqs:eu-west-1:861803281599:SPNotificationQueue"
    }
  }
}

回应:

{
    "errors": [
        {
            "message": "Access to requested resource is denied.",
            "code": "Unauthorized",
            "details": "Access token is missing in the request header."
        }
    ]
}
qlzsbp2j

qlzsbp2j1#

必须执行发布请求以:https://api.amazon.com/auth/o2/token

然后将access_token(以Atza开头)作为x-amz-access-token包含在头中

相关问题