Problem description
The request does not contain a valid date header required for signature authentication.
Causes
The request includes an Authorization header but omits both the Date header and the x-oss-date header. OSS requires at least one of these headers to validate the request timestamp during signature verification.
Examples
The following request triggers this error. It includes a signature in the Authorization header but no Date or x-oss-date header:
GET /oss.jpg HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Authorization:OSS LTAI****************:UNQD*************************Solutions
Add one of the following headers to the request.
Option 1: Add the Date header
GET /oss.jpg HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Authorization:OSS LTAI****************:UNQD*************************
Date: Tue, 20 Dec 2022 08:48:18 GMTOption 2: Add the x-oss-date header
GET /oss.jpg HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Authorization:OSS LTAI****************:UNQD*************************
x-oss-date: 20221220T084818ZNote
To avoid managing date headers and signing logic manually, use the OSS SDK to send requests with V4 signature. For details, see Overview.
References
该文章对您有帮助吗?