0002-00000218

更新时间:
复制 MD 格式

Problem description

The x-oss-credential field in the signature request is left blank.

Causes

The request uses V4 signature, but the x-oss-credential field is blank.

Examples

The following URL-based request uses V4 signature with a blank x-oss-credential value:

GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=&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

x-oss-credential is required. Its value must follow this format: <AccessKeyId>/<SignDate>/<Region>/oss/aliyun_v4_request.

Solutions

Specify x-oss-signature-verion, x-oss-credential, x-oss-expires, and x-oss-signature in the request. x-oss-additional-headers is optional. The following request shows a correctly set x-oss-credential value:

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

If the server returns a response that contains the StringToSign parameter, verify that the value of StringToSign on the server matches the string used before signing.