Problem description
The AccessKeyId value in the Authorization header is invalid.
Causes
The AccessKeyId field in the Authorization header has an invalid value. A common example is a tab character (\t) included in the value.
Examples
The following request triggers this error because the AccessKeyId value contains \t:
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
Construct the Authorization header using the following format:
Authorization = "OSS " + AccessKeyId + ":" + SignatureWhere Signature is:
Signature = base64(hmac-sha1(AccessKeySecret,
VERB + "\n"
+ Content-MD5 + "\n"
+ Content-Type + "\n"
+ Date + "\n"
+ CanonicalizedOSSHeaders
+ CanonicalizedResource))| Component | Description |
|---|---|
OSS | Literal prefix — note the trailing space |
AccessKeyId | Your access key ID — must contain only valid characters, with no whitespace or control characters |
Signature | base64-encoded HMAC-SHA1 of the signing string |
Make sure the AccessKeyId value contains no illegal characters before constructing the header. For the full signing procedure, see Include signatures in the Authorization header.
Tip: Use Alibaba Cloud SDKs to generate signatures automatically. SDKs handle the signing process for you, eliminating this class of error. See Overview.
该文章对您有帮助吗?