使用Hammock库进行Linkedin访问;oauth在=0”时到期;错误
本文关键字:错误 oauth Hammock 访问 Linkedin 使用 | 更新日期: 2023-09-27 18:23:49
我在windows移动应用程序中使用吊床库访问Linkedin。我修改了twitter Hammock库以进行链接访问。在访问令牌之后,它声明。
"oauth_token=538e6cce-7fb4-40f7-baab-1a1dc73af28d&oauth_token_secret=8cc5c61b-a1-44ba-b1c3-9b55f1945b9c&oauth_expires_in=0&0Auth_auth_authentication_expires_in=0"
这里,在访问令牌步骤中,我注意到"oauth expires in = 0".
那么,这是因为oauth图书馆的问题吗?我搜索了很多网站,尝试了很多。
在下面的代码之后,我得到了这个错误。
var client = new RestClient
{
Authority = "https://api.linkedin.com/uas/oauth",
Credentials = credentials,
HasElevatedPermissions = true
};
var request = new RestRequest
{
Path = "/accessToken",
Credentials = credentials
};
client.BeginRequest(request, new RestCallback(RequestAccessTokenCompleted));
在获得访问令牌后,我获得了linkedin登录页面的授权。我想在linken分享中发布一个链接。当我给出post方法时,我在下面的代码中出现了错误。我为此修改了twitter库。请引导我…
_client = new RestClient
{
Authority = "http://api.linkedin.com/v1",
Credentials = _credentials,
HasElevatedPermissions = true,
// Method = WebMethod.Post
};
}
public void NewTweet(string tweetText)
{
if (!_authorized)
{
if (ErrorEvent != null)
ErrorEvent(this, EventArgs.Empty);
return;
}
var request = new RestRequest
{
Credentials = _credentials,
Path = "/people/~/shares",
Method = WebMethod.Post
};
// _client.AddHeader("Content-Type", tweetText);
_client.AddParameter("Content-Type", tweetText);
_client.BeginRequest(request, new RestCallback(NewTweetCompleted));
}
当令牌在"0"中过期时,意味着该令牌无限期有效,或者直到用户取消对其的授权。继续使用该令牌进行OAuth调用,它将对您有效。