0002-00000103
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>| Component | Required | Description |
|---|---|---|
OSS2 | Yes | Signature version. Only OSS2 is supported. |
AccessKeyId | Yes | Your Alibaba Cloud access key ID. |
AdditionalHeaders | No | Additional headers included in the signature. |
Signature | Yes | The 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
To use Alibaba Cloud SDKs to sign V2 requests, see Overview.
To calculate the V2 signature manually, see the OSS SDK for Python signature implementation.
To understand the full V2 signature specification, see Overview.