0002-00000215
Problem description
The signature expiration time is missing from the request.
Causes
You sent a request that uses a v4 signature, but the request parameters are missing the x-oss-expires field. This field specifies the expiration time of the signature.
Examples
You included v4 signature information in the request URL, but the x-oss-expires field is missing from the request parameters.
GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=***&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 GMT
The x-oss-expires request parameter is required. It specifies the validity period of the signature as a UNIX timestamp.
Solutions
A request URL that uses a v4 signature must include four required parameters: x-oss-signature-version, x-oss-credential, x-oss-expires, and x-oss-signature. It can also include one optional parameter: x-oss-additional-headers. The following code provides a valid example:
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 GMT
References
-
For information about how to use Alibaba Cloud SDKs to initiate a request that uses the V4 signature, see Overview.
-
Calculate the signature:
-
For information about how to calculate the V4 signature, see Calculate V4 signature by using OSS SDK for Python.
-
For information about how to specify the signature logic based on the V1 signature, see Overview.
If the server returns a response that contains the
StringToSignparameter, you must check whether the value of the StringToSign parameter on the server is the same as the string before calculation. -