0002-00000503

更新时间:
复制 MD 格式

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 GMT

Option 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: 20221220T084818Z
Note

To avoid managing date headers and signing logic manually, use the OSS SDK to send requests with V4 signature. For details, see Overview.

References