Skip to content

Commit

Permalink
Merge pull request #472 from haoxiuwen/doc-v2
Browse files Browse the repository at this point in the history
Modify Dynamic Token Generation Doc
  • Loading branch information
haoxiuwen authored Oct 23, 2023
2 parents dbf9dcc + a43fd47 commit a71c338
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/product/easemob_user_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ b. 设置过期时间,单位为秒。
ttl = 600
c. 生成 signature,将 clientId、appkey、userId、curTime、ttl、clientSecret 六个字段拼成一个字符串,进行 sha1 编码并将编码内容得到的字节转换为十六进制字符串。
str = clientId + appkey + userId + curTime + ttl + clientSecret
shaBytes = sha1(str)
sha256hash = sha256.Sum256([]byte(str))
signature = fmt.Sprintf("%x", shaBytes)
d. 组装为 json。
json = {"signature": "xx", "appkey":"xx#xx", "userId":"xx", "curTime":1686207557, "ttl": 600}
Expand Down

0 comments on commit a71c338

Please sign in to comment.