0002-00000711

更新时间:
复制 MD 格式

Problem description

The value of the x-amz-credential header in the PostObject request is invalid.

Causes

The PostObject request uses an Amazon S3-compatible V4 signature, but the x-amz-credential header value does not contain the required five fields.

Examples

The following request uses an x-amz-credential header with only four fields. The oss service name is missing.

x-amz-credential: EXAMPLEAKID/20170710/cn-hangzhou/aws4_request

The x-amz-credential header must contain five fields separated by forward slashes (/):

x-amz-credential: EXAMPLEAKID/20170710/cn-hangzhou/oss/aws4_request

Solutions

Set x-amz-credential to the following format:

<Access-Key-ID>/YYYYMMDD/<region>/<service>/aws4_request
FieldDescriptionExample
<Access-Key-ID>Your Alibaba Cloud AccessKey IDEXAMPLEAKID
YYYYMMDDThe date the request is signed, in YYYYMMDD format20170710
<region>The OSS region ID where the bucket is locatedcn-hangzhou
<service>The service name. For OSS, always use ossoss
aws4_requestA literal string required by AWS Signature Version 4aws4_request

For more information about the PostObject operation, see PostObject.