0002-00000406

Updated at:

Problem description

The value of the Authorization request header is in an invalid format.

Causes

You sent a request that uses an Amazon S3-compatible V4 signature, but the value of the Authorization request header is in an invalid format.

Examples

You sent a request that includes a signature in the request header, but the value of the Authorization field is in an invalid format.

GET /test.txt HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Authorization:AWS4-HMAC-SHA256 Credential=LTAI****************/20221220/us-east-1/s3/aws4_requestSignedHeaders=host;x-amz-content-sha256;x-amz-dateSignature=ab2s********************
x-amz-content-sha256: abc***
x-amz-date: 20221220T084818Z
x-oss-s3-compat: true

The value of the Authorization field includes the Credential, SignedHeaders, and Signature components. These components must be separated by commas (,). In the preceding example, the comma between Credential and SignedHeaders is missing.

Solutions

Make sure that the Authorization field is complete and in the correct format.

GET /test.txt HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Authorization:AWS4-HMAC-SHA256 Credential=LTAI****************/20221220/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=ab2s********************
x-amz-content-sha256: abc****
x-amz-date: 20221220T084818Z
x-oss-s3-compat: true

We recommend that you use Amazon S3 SDKs to initiate the request. For more information, see Use Amazon S3 SDKs to access OSS.