0002-00000103

Updated at:

Problem description

The Authorization request header format is invalid.

Causes

The request uses the V2 signature (OSS2), but the Authorization header is malformed.

Examples

A V2-signed Authorization header uses this structure:

Authorization: OSS2 <AccessKeyId>:<value>,<AdditionalHeaders>:<value>,<Signature>:<value>
ComponentRequiredDescription
OSS2YesSignature version. Only OSS2 is supported.
AccessKeyIdYesYour Alibaba Cloud access key ID.
AdditionalHeadersNoAdditional headers included in the signature.
SignatureYesThe computed request signature.

Delimiter rules:

  • Separate the signature version (OSS2) from the signature information with a space.

  • Separate key-value pairs with a comma (,).

  • Separate each key from its value with a colon (:).

The following request has a malformed Authorization header:

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,AdditionalHeadershost,Signature:n7I**I0=

The AdditionalHeaders key-value pair is missing a colon: AdditionalHeadershost should be AdditionalHeaders:host.

Solutions

Add the missing colon separator to the AdditionalHeaders key-value pair:

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 server response contains the StringToSign parameter, compare its value with the StringToSign computed on your client to debug signature issues further.

References