0002-00000303

更新时间:
复制 MD 格式

Problem description

The AccessKeyId field is missing from the request.

Causes

The request uses an Amazon S3-compatible signature but does not include the AWSAccessKeyId query parameter.

S3-compatible presigned URLs require all three of the following query parameters:

ParameterDescription
AWSAccessKeyIdIdentifies the access key used to sign the request
ExpiresUnix timestamp after which the URL is no longer valid
SignatureHMAC signature calculated from the request and your secret key

If any of these parameters is missing, OSS cannot validate the request and returns this error.

Examples

The following request uses an S3-compatible signature but omits AWSAccessKeyId:

GET /test.txt?Expires=1141889120&Signature=vjbyPxybdZaNmGa%2ByT272YEAiv**** HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
x-oss-s3-compat: true

Solutions

Add the missing AWSAccessKeyId parameter to your request. A complete request looks like this:

GET /test.txt?AWSAccessKeyId=nz2p****&Expires=1141889120&Signature=vjbyPxybdZaNmGa%2ByT272YEAiv**** HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
x-oss-s3-compat: true

To avoid constructing presigned URLs manually, use Amazon S3 SDKs to generate requests. For details, see Use Amazon S3 SDKs to access OSS.