All Products
Search
Document Center

Object Storage Service:0002-00000404

Last Updated:Apr 25, 2025

Issue description

The Credential field in the Authorization request header is incomplete.

Causes

You initiated a request that uses an Amazon S3-compatible V4 signature. The value of the Credential field in the Authorization request header is incomplete.

Example

You initiated a request, but the value of the Credential field in the Authorization request header is incomplete.

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****************/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

The Credential field is in the following format: <YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request. In the preceding example, the YYYYMMDD field that specifies the signature date is missing.

Solution

Make sure that the Authorization request header is complete and correctly calculated. The following code provides an example on how to correctly specify the Credential field in the Authorization request header:

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.