0002-00000106

更新时间:
复制 MD 格式

Problem description

The AccessKeyId field in the Authorization header is blank.

Causes

The request uses the V2 signature, but the AccessKeyId field in the Authorization header has no value.

Examples

The following request uses the V2 signature with an invalid 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:,AdditionalHeaders:host,Signature:n7I**I0=

Note the :, sequence: the value between the colon and the comma is blank.

The Authorization header for V2 signature requests uses this structure:

OSS2 <signature-information>

The signature version (OSS2) and signature information are separated by a space. Only OSS2 is supported as the signature version. Signature information is a comma-separated list of key:value pairs:

FieldRequiredDescription
AccessKeyIdYesYour Alibaba Cloud AccessKey ID
SignatureYesThe computed signature string
AdditionalHeadersNoAdditional headers included in the signature

In the invalid example above, AccessKeyId is used as a key but has no value.

Solutions

Set AccessKeyId to your Alibaba Cloud AccessKey ID. The following request shows the correct format:

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 returns a StringToSign parameter in the error response, compare that value with the string you constructed before signing. A mismatch indicates an error in how you built the string to sign.

References