0002-00000061

Updated at:

Problem description

The signature format is invalid.

Cause

The request header contains a signature with an invalid format.

Problem Examples

The request includes a signature in the 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: OSSxxx qn6q**************:77Dv****************

The value of the Authorization field identifies the signature type and typically starts with OSS. For Amazon S3-compatible requests, the value must start with AWS.

Solution

Calculate the value of the Authorization field as follows:

Authorization = "OSS " + AccessKeyId + ":" + Signature
Signature = base64(hmac-sha1(AccessKeySecret,
            VERB + "\n"
            + Content-MD5 + "\n" 
            + Content-Type + "\n" 
            + Date + "\n" 
            + CanonicalizedOSSHeaders
            + CanonicalizedResource))

For more information about how to calculate the value of the Authorization field, see Include signatures in the Authorization header.

Note

You can use an SDK to send requests to avoid the manual signing process. For more information, see Overview of sending requests using an SDK or Access OSS using an AWS SDK.