Problem description
The request is missing the x-oss-expires parameter, which specifies the validity period of the V2 URL signature.
Causes
When you include a V2 signature (x-oss-signature-verion=OSS2) in the URL, the x-oss-expires parameter is required. This parameter is missing from the request.
Examples
The following request is missing x-oss-expires and triggers this error:
GET /oss.jpg?x-oss-signature-verion=OSS2&x-oss-access-key-id=nz2pc56s936****&x-oss-signature=a8***I0= HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Tue, 20 Dec 2022 08:48:18 GMTSolutions
Add x-oss-expires to the query string. A V2 signed URL requires the following four parameters:
| Parameter | Description | Example |
|---|---|---|
x-oss-signature-verion | Signature version. Set to OSS2 for V2 signatures. | OSS2 |
x-oss-access-key-id | Your AccessKey ID. | nz2pc56s936**** |
x-oss-expires | Signature expiration time as a Unix timestamp. After this time, OSS rejects the URL. | 1141889120 |
x-oss-signature | The computed signature value. | a8***I0= |
The following request includes all required parameters:
GET /oss.jpg?x-oss-signature-verion=OSS2&x-oss-access-key-id=nz2pc56s936****&x-oss-expires=1141889120&x-oss-signature=a8***I0= HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Tue, 20 Dec 2022 08:48:18 GMTFor details on constructing V2 signed URLs, see Add signatures to URLs.
To avoid constructing signed URLs manually, use an Alibaba Cloud SDK. Alibaba Cloud SDKs automatically generate signatures for the requests. For available SDKs, see Overview.