在.net中为xing 401提供验证

本文关键字:验证 xing net 中为 | 更新日期: 2023-09-27 18:13:03

我正在尝试用c#为xing api编写OAuth示例:.NET中带验证的OAuth

当我试图获取我自己的用户信息时,我总是得到错误消息:

OAuth签名无效

任何想法?

Thx

丹尼斯

在.net中为xing 401提供验证

晚了几年,但我已经遇到并解决了这个问题,所以如果有人回到这里:在Manager类中的GetSignatureBase中,您需要更改

if (!string.IsNullOrEmpty(this._params[p1.Key]) &&
     !p1.Key.EndsWith("_secret") &&
     !p1.Key.EndsWith("signature"))
    p.Add("oauth_" + p1.Key, p1.Value); 

以与构建请求时相同的方式对值进行uri编码:

if (!string.IsNullOrEmpty(this._params[p1.Key]) &&
     !p1.Key.EndsWith("_secret") &&
     !p1.Key.EndsWith("signature"))
    p.Add("oauth_" + p1.Key, UrlEncode(p1.Value));