Skip to content

Commit

Permalink
Update 接口鉴权.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardhunt authored Nov 20, 2024
1 parent f19edf5 commit 56b8751
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
有了安全凭证SecretId 和 SecretKey后,就可以生成签名串了。以下是生成签名串的详细过程:

假设用户的 SecretId 和 SecretKey 分别是:
> SecretId: AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE
> SecretKey: Gu5t9xGARNpq86cd98joQYCN3EXAMPLE
> SecretId: AKID**********************0123456789
> SecretKey: sk0123456789********************
**注意:这里只是示例,请请根据用户实际申请的SecretId和SecretKey进行后续操作!**

Expand All @@ -35,7 +35,7 @@
| 参数名称 | 中文 | 参数值 |
| ------------- | -------------- | ------------------------------------ |
| Action | 方法名 | DescribeInstances |
| SecretId | 密钥Id | AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE |
| SecretId | 密钥Id | AKID**********************0123456789 |
| Timestamp | 当前时间戳 | 1465185768 |
| Nonce | 随机正整数 | 11886 |
| Region | 实例所在区域 | ap-guangzhou |
Expand All @@ -57,7 +57,7 @@
'Nonce' : 11886,
'Offset' : 0,
'Region' : 'ap-guangzhou',
'SecretId' : 'AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE',
'SecretId' : 'AKID**********************0123456789',
'Timestamp' : 1465185768,
'Version': '2017-03-12',
}
Expand All @@ -73,7 +73,7 @@
然后将格式化后的各个参数用"&"拼接在一起,最终生成的请求字符串为:

```
Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12
Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789&Timestamp=1465185768&Version=2017-03-12
```

### 2.3. 拼接签名原文字符串
Expand All @@ -91,7 +91,7 @@ Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=
示例的拼接结果为:

```
GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE&Timestamp=1465185768&Version=2017-03-12
GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKID**********************0123456789&Timestamp=1465185768&Version=2017-03-12
```

### 2.4. 生成签名串
Expand Down Expand Up @@ -131,4 +131,4 @@ v9MVG3fopp/gCsLSZ4gMFeYGgDU=
| AuthFailure.SignatureFailure | 签名错误 |
| AuthFailure.TokenFailure | token 错误 |
| AuthFailure.MFAFailure | MFA 错误 |
| AuthFailure.InvalidSecretId | 密钥非法(不是云 API 密钥类型) |
| AuthFailure.InvalidSecretId | 密钥非法(不是云 API 密钥类型) |

0 comments on commit 56b8751

Please sign in to comment.