Problem description
The value of the AccessKeyId
field in the signature request is invalid.
Causes
You initiated a signature request in which the AccessKeyId
field in the Authorization
header has an invalid value.
Examples
The following code provides an example of a signature request in which the value of the AccessKeyId
field in the Authorization
header is invalid. For example, \t
is included in the value of the AccessKeyId
field.
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 qn6qrrqxo2\t:UNQDb7GapEgJkcde6OhZ9J*****
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.
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.