请教一下天涯的第三方登陆啊,第一次请求就失败了
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));