Splicing authorization
2 min
Assemble the authorization in the following format:
Authorization =
Algorithm + ' ' +
'Credential=' + AccessKey + '/' + CredentialScope + ', ' +
'SignedHeaders=' + SignedHeaders + ', ' +
'Signature=' + SignatureName | Description |
|---|---|
Algorithm | Signature method,fixed as: K1-HMAC-SHA256 |
AccessKey | AccessKey in key pair, that is: AKIDz8krbsJ5yKBZQpn74WFkmLPx3******* |
CredentialScope | Voucher scope. The result of this example is: 2019-02-25/cbms/k1_request |
SignedHeaders | The header information participating in the signature. The value of this example is: content-type;host |
Signature | Signature value. The result of this example is: 2230eefd229f582d8b1b891af7107b91597240707d778ab3738f756258d7652ct |
According to the above rules, the value of this example is:
K1-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******/2019-02-25/cbms/k1_request, SignedHeaders=content-type;host, Signature=2230eefd229f582d8b1b891af7107b91597240707d778ab3738f756258d7652cFinally, the complete call information is as follows:
GET https://api-testing.klavi.ai/link/external/v2/getInstitutionList
Authorization: K1-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******/2019-02-25/cbms/k1_request, SignedHeaders=content-type;host, Signature=2230eefd229f582d8b1b891af7107b91597240707d778ab3738f756258d7652c
Content-Type: application/json; charset=utf-8
Host: api-testing.klavi.ai
X-Action: getInstitutionList
X-Timestamp: 1551113065
X-Region: ap-brazil