0002-00000109

更新时间:
复制 MD 格式

Problem description

The Signature field in the Authorization request header is blank.

Causes

The request uses a V2 signature, but the Signature field in the Authorization header has no value after the colon.

Examples

The following request uses a V2 signature, but the Signature field is blank:

GET /oss.jpg HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Tue, 20 Dec 2022 08:48:18 GMT
Authorization: OSS2 AccessKeyId:44**07,AdditionalHeaders:host,Signature:

A valid V2 Authorization header uses a single space to separate the signature version (OSS2) from the signature information. The signature information is a comma-separated list of key:value pairs:

FieldRequiredDescription
AccessKeyIdYesYour Alibaba Cloud AccessKey ID
SignatureYesThe signature value — must not be blank
AdditionalHeadersNoAdditional headers included in the signature calculation

Solutions

Make sure the Signature field contains a non-blank value. The following is a valid request:

GET /oss.jpg HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Tue, 20 Dec 2022 08:48:18 GMT
Authorization: OSS2 AccessKeyId:44**07,AdditionalHeaders:host,Signature:n7I**I0=

If the Signature value is blank, check that your signature calculation produces a non-empty result and that the computed value is written to the Signature field before the request is sent.

If the server returns a response that contains the StringToSign parameter, you can compare the StringToSign value your code produces against the StringToSign value in the server's response. If they differ, the issue is in how you construct the string-to-sign.

References