首页 新闻 搜索 专区 学院

请教一下天涯的第三方登陆啊,第一次请求就失败了

0
悬赏园豆:50 [待解决问题]

请教一下天涯的第三方登陆啊,第一次请求就失败了

 

string randString = "tianyalogin";
Dictionary<string, object> config = new Dictionary<string, object>();
config.Add("oauth_consumer_key", this.AppKey);
//config.Add("oauth_signature", "ignored");
config.Add("oauth_signature_method", "HMAC-SHA1");
string timestamp = ((int)(DateTime.Now - TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1))).TotalSeconds).ToString();
config.Add("oauth_timestamp", timestamp);
config.Add("oauth_version", "1.0");
config.Add("oauth_nonce", randString);

string callbackurl = HttpUtility.UrlEncode("http://open.tianya.cn/oauth/request_token.php");
string baseString = "GET%26" + callbackurl;
baseString += "%26oauth_consumer_key%3D" + HttpUtility.UrlEncode(this.AppKey);
baseString += "%26oauth_nonce%3D" + HttpUtility.UrlEncode(randString);
baseString += "%26oauth_signature_method%3D" + HttpUtility.UrlEncode("HMAC-SHA1");
baseString += "%26oauth_timestamp%3D" + HttpUtility.UrlEncode(timestamp.ToString());
baseString += "%26oauth_version%3D" + HttpUtility.UrlEncode("1.0");

config.Add("oauth_signature", BuildEncodedSig(baseString, randString));

Care健康的主页 Care健康 | 初学一级 | 园豆:157
提问于:2013-05-09 14:50
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册