0

HMAC-SHA1 签名方法需要一个由客户端共享密钥“&”和令牌共享密钥连接形成的密钥。

我想知道当客户端仍然没有请求或访问令牌时,我应该为令牌共享密钥使用哪个值:客户端再次共享密钥或将其留空。

从规范:

3.4.2. HMAC-SHA1

“HMAC-SHA1”签名方法使用 [RFC2104] 中定义的 HMAC-SHA1 签名算法:

 digest = HMAC-SHA1 (key, text)

HMAC-SHA1 函数变量的使用方式如下:

text 设置为第 3.4.1.1 节中的签名基本字符串的值。

key 设置为以下的连接值:

      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”协议参数的值,根据 [RFC2045] 第 6.8 节的结果八位字节字符串进行 base64 编码。

谢谢

4

1 回答 1

1

当令牌共享密钥不可用时,密钥应设置为客户端共享密钥加上“&”字符。

于 2013-02-27T14:45:34.700 回答