0002-00000102

更新时间:
复制 MD 格式

Problem description

The format of the Authorization request header is invalid.

Causes

The request uses the V2 signature, but the Authorization header does not meet the format requirements. The header must include:

  • A signature version (OSS2), separated from the key-value pairs by a space

  • Two or three key-value pairs in the signature information section

FieldRequiredDescription
AccessKeyIdYesYour AccessKey ID
SignatureYesThe calculated signature string
AdditionalHeadersNoAdditional headers included in the signature calculation

Delimiter rules:

DelimiterUsage
Space ( )Between OSS2 and the key-value pairs
Colon (:)Between each key and its value
Comma (,)Between key-value pairs

The full header structure follows this format:

Authorization = "OSS2" + " " + AccessKeyId:<value> + "," + [AdditionalHeaders:<value>,] + Signature:<value>

Examples

The following request triggers this error. The Signature field is missing — only AccessKeyId is present, and the trailing comma leaves the header incomplete:

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,

Solutions

Include both AccessKeyId and Signature in the Authorization header. If you signed additional headers, also include AdditionalHeaders:

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=
Note: Line breaks are added for readability. The actual Authorization header value must be a single line.

If the server returns a response that contains the StringToSign parameter, check whether the StringToSign value on the server matches the string you calculated before signing.

References