HMAC-SHA1签名方法需要一个由客户端共享密钥串联形成的密钥,'&'和令牌共享秘密。
我想知道当客户端仍然没有请求或访问令牌时,我应该使用哪个值作为令牌共享密钥:客户端再次共享密码或将其留空。
来自规范:
3.4.2。 HMAC-SHA1
“HMAC-SHA1”签名方法使用HMAC-SHA1签名 [RFC2104]中定义的算法:
digest = HMAC-SHA1 (key, text)
HMAC-SHA1功能变量以下列方式使用:
text设置为签名基本字符串的值 第3.4.1.1节。
键设置为以下连接值:
1. The client shared-secret, after being encoded (Section 3.6). 2. An "&" character (ASCII code 38), which MUST be included even when either secret is empty. 3. The token shared-secret, after being encoded (Section 3.6).
摘要用于设置“oauth_signature”协议的值 参数,在结果八位字符串之后是base64编码的 根据[RFC2045],第6.8节。
由于
答案 0 :(得分:1)
密钥应设置为客户端共享密钥加上“&”令牌共享密钥不可用时的字符。