Problem description
A V4 signed request to OSS failed because the x-oss-signature header is missing.
Causes
The request includes V4 signature parameters (such as x-oss-signature-verion=OSS4-HMAC-SHA256) but omits the required x-oss-signature header, which carries the computed signature value.
Examples
The following request contains x-oss-signature-verion, x-oss-credential, and x-oss-expires, but is missing x-oss-signature:
GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=***&x-oss-expires=1141889120&x-oss-additional-headers=host HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Tue, 20 Dec 2022 08:48:18 GMTNote: Line breaks are added for readability. In practice, all parameters appear in a single query string.
Solutions
Include all required fields in the request. The following shows a complete, valid V4 signed request:
GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=LTAI****************/20221220/cn-hangzhou/oss/aliyun_v4_request&x-oss-expires=1141889120&x-oss-additional-headers=host&x-oss-signature=8u**a3 HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Tue, 20 Dec 2022 08:48:18 GMTRequired fields
| Parameter | Required | Description |
|---|---|---|
x-oss-signature-verion | Yes | Signing algorithm identifier. Set to OSS4-HMAC-SHA256 for V4 signatures. |
x-oss-credential | Yes | Your access key ID combined with the credential scope, in the format <AccessKeyId>/<date>/<region>/oss/aliyun_v4_request. For example: LTAI****************/20221220/cn-hangzhou/oss/aliyun_v4_request. |
x-oss-expires | Yes | Signature expiration time. |
x-oss-signature | Yes | The calculated signature value. This is the field that was missing from the request. |
x-oss-additional-headers | No | Additional headers included in the signature calculation. |
If the server returns a response that contains the StringToSign parameter, compare it against the string you used as input before signing. A mismatch indicates a signing logic error.
References
To use an Alibaba Cloud SDK to send V4 signed requests, see Overview.
To calculate the V4 signature manually, see the OSS SDK for Python implementation.
For V1 signature details, see Overview.