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 spaceTwo or three key-value pairs in the signature information section
| Field | Required | Description |
|---|---|---|
AccessKeyId | Yes | Your AccessKey ID |
Signature | Yes | The calculated signature string |
AdditionalHeaders | No | Additional headers included in the signature calculation |
Delimiter rules:
| Delimiter | Usage |
|---|---|
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
If you use an Alibaba Cloud SDK to send requests with the V2 signature, see Overview for the list of supported SDKs.
If you use the self-signed mode, see Calculate V2 signature by using OSS SDK for Python for a reference implementation, and Overview for the signature specification.