All Products
Search
Document Center

Object Storage Service:0002-00000062

Last Updated:Apr 29, 2024

Problem description

The signature format is invalid.

Causes

The signature format in the Authorization header is invalid.

Examples

You initiated a request to include the signature in the Authorization header, but the format of the Authorization header is invalid. For example, the colon (:) used to separate the AccessKey ID and the signature is missing in the Authorization 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: OSS qn6q**************:77Dv****************

Solutions

The following code provides an example on how to calculate the value of the Authorization header:

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 Authorization header, see Include signatures in the Authorization header.

Note

We recommend that you use Alibaba Cloud SDKs to initiate requests. Alibaba Cloud SDKs automatically generate signatures for the requests without the need to manually calculate a signature. For more information, see Overview.