工业数字模型驱动引擎-auth Token取值说明:举例

时间:2024-01-26 17:46:46

举例

商家收到的调用请求示例如下:

post方式:
https://www.isvwebsite.com/saasproduce
Connection: keep-alive
Content-Type: application/json
authToken: “xxxxxxxxxxxxxx”
Host: www.isvwebsite.com
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_191)
{
"p1": "1",
"p2": "2",
"p3": "3",
"timeStamp": "201706211855321"
}
  1. 获取所有的post请求body参数:p1、p2、p3、timeStamp
  2. 进行字典排序:sort(p1, p2, p3,timeStamp),假设排序后的顺序是p1、p3、p2、timeStamp
  3. 生成authToken值:base64_encode(HMAC_SHA256(Key+timeStamp, p1=1&p3=3&p2=2&timeStamp=201706211855321))

所有参数的值云商店都经过了URL编码,商家取到参数值应先进行URL解码。

support.huaweicloud.com/accessg-saascenter/saascenter_accessg_0108.html