Problem description
The Authorization header in the request is blank.
Causes
The request uses an Amazon S3-compatible V4 signature (AWS Signature Version 4), but the Authorization header has no value.
Examples
The following request triggers this error. The Authorization header is present but blank, so OSS rejects the request.
GET /test.txt HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Authorization:
x-amz-content-sha256: abc***
x-amz-date: 20221220T084818Z
x-oss-s3-compat: trueSolutions
Include a valid value in the Authorization header. The value must follow the AWS Signature Version 4 format:
Authorization:AWS4-HMAC-SHA256 Credential=<access-key-id>/<date>/<region>/s3/aws4_request,SignedHeaders=<signed-headers>,Signature=<signature>The following table describes each component:
| Component | Description | Example |
|---|---|---|
AWS4-HMAC-SHA256 | The signing algorithm. Required for AWS Signature Version 4. | AWS4-HMAC-SHA256 |
Credential | Your access key ID followed by the credential scope: <access-key-id>/<date>/<region>/s3/aws4_request | LTAI****************/20221220/us-east-1/s3/aws4_request |
SignedHeaders | A semicolon-separated list of headers included in the signature. | host;x-amz-content-sha256;x-amz-date |
Signature | The HMAC-SHA256 signature of the request. | 34**** |
The following is an example of a correctly signed request:
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=34****
x-amz-content-sha256: abc****
x-amz-date: 20221220T084818Z
x-oss-s3-compat: trueTo avoid manual signing errors, use an Amazon S3 SDK to construct and sign requests automatically. The SDK generates a valid Authorization header. For setup instructions, see Use Amazon S3 SDKs to access OSS.
该文章对您有帮助吗?