Tag: linkedin

LInkedIn oAuth2请求令牌400错误请求

我正在与LinkedIN API争夺第二天,每次我试图获得一个令牌,我得到400 Bad Request。 这是我的代码,也许有人可以帮忙吗? public void RequestAuthentication(System.Web.HttpContextBase context, System.Uri returnUrl) { string url = String.Format(“https://www.linkedin.com/uas/oauth2/authorization?response_type=code” + “&client_id={0}” + “&scope={1}” + “&state={3}” + “&redirect_uri={2}”,this._consumerKey,_scope,HttpUtility.UrlEncode(returnUrl.ToString()),Guid.NewGuid().ToString()); context.Response.Redirect(url); } public AuthenticationResult VerifyAuthentication(System.Web.HttpContextBase context) { //TODO: check CSRF string code = context.Request.QueryString[“code”]; string rawUrl = context.Request.Url.OriginalString; //From this we need to remove code portion rawUrl = Regex.Replace(rawUrl, “&code=[^&]*”, “”); […]

在linkedin服务器上暂时不可用

我是新手使用linkedin编程并尝试获取一些用户数据,但是我无法进一步了解https://www.linkedin.com/uas/oauth2/accessToken ,我得到了这个响应: {“error”:“temporary_unavailable”,“error_description”:“授权服务器当前无法处理请求:RestException {_response = RestResponse [headers = {X-LinkedIn-Error-Response = true,Content-Length = 6936, X-Restli-Protocol-Version = 1.0.0,Server = Jetty(8.1.8.v20121106)},status = 404,entityLength = 6936]}“} 我使用以下带参数的url: https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code&code=AQR4LKsR8tswI4o-Ej0bE6vg1fhAZntPuT26CFMFEhZZh7zFkLM7PyxRRp5XEzZ-Y45vIBwZam8zDncMECldDrCSJI8WKNlxrR5gsAcxmkga0ZzIM38&redirect_uri=http://localhost:30731/redirect.aspx&client_id=OAuth用户令牌&client_secret = OAuth的用户秘密 我在C#中得到的错误是服务器是不可用的,它与JSON消息相对应。 有人确实知道解决方案或有相同的错误或解决方案吗?

如何使用LinkedIn API JavaScript SDK获取访问令牌

我想在登录后获得LinkedIn Access Token。 使用JavaScript SDK,登录工作正常,我可以收到“oauth_token”和member_id 。 我需要access_token来validation电子邮件地址(如果它没有伪造的话)。 以下是我的脚本: function LoginWithLinkedIn() { IN.User.authorize(afterAuthorization); } function afterAuthorization(response){ debugger if(IN.User.isAuthorized()==true){ getProfileData(); } } function onSuccess(data) { console.log(data); } function onError(error) { console.log(error); } function getProfileData(r) { IN.API.Profile(“me”) .fields(“id,firstName,lastName,email-address,picture-urls::(original),public-profile-url,location:(name)”) .result(onSuccess) .error(onError); } 成功授权后,我需要帮助获取access_token。 任何帮助都非常感谢! 谢谢!

Asp.Net MVC LinkedIn OAuth 2.0登录令人惊叹

LinkedIn登录已突然停止工作,错误代码错误= access_denied ,代码库或包中没有任何更改。 根据文档错误代码access_denied ,表示用户已拒绝许可,但即使给予权限也会发生,我们只请求默认信息电子邮件ID。 问题是返回的用户信息始终为null。 使用的Nuget包是Owin.Security.Providers.LinkedIn :2.22.0,我们试图更新它,但它没有解决问题。 为了诊断我们检查了LinkedIn应用程序设置它看起来很好,也登录工作通过javascript sdk相同的应用程序ID,所以问题似乎不是与应用程序ID。 在github中没有与它相关的问题。 所以,不确定根本问题在哪里。 任何指针或问题的解决方案都会有所帮助。

使用Share Api发布到Linkedin

我在Asp.net应用程序中实现LinkedIN Share Api时遇到了困难。 谁能帮我 ? 我找到了LinkedIN Share API的文档( https://developer.linkedin.com/documents/share-api )。 这是说我应该创建一个XML进行共享,并将其发布到URL“ http://api.linkedin.com/v1/people/~/shares ” 阅读本文后我有两个疑问 如何将令牌与XML一起传递给服务器,文档中没有告知它? 他发布的XML内容的名称/密钥应该是什么? 要求是:我需要与帐户中链接的用户共享更新(“只是文本”。要共享的文本由用户通过文本框提供(因此它只包含文本) 我正在使用LinkedIn OAuth Library 0.6.1 For Authentication 。 由于我在这个库中没有找到任何方法(有助于发布),我打算直接使用Share API。 并使用“ HttpWebRequest ”类发布到Linkedin 我到现在为止做了什么: 1.处理链接的应用程序,所以我得到了App-Key和App-Key 2.为了进行身份validation,使用OAuth Library 0.6.1中的BeginAuthMethod将用户重定向到链接 var token = OAuthManager.Current.CreateToken(callback: this.AppRedirectUrl); OAuthManager.Current.BeginAuth (token, endResponse: true, displayAllowDenyScreen: false); 3.身份validation后我收到来自链接的响应,我使用该身份validation令来获取这样的usertoken var token = OAuthManager.Current.GetTokenInCallback(); var session = OAuthManager.Current.CompleteAuth(token); this.UserToken […]

检索Linkedin电子邮件地址

我正在使用Hammock库和C#来获取用户的基本个人资料和电子邮件地址,链接在以下post中。 我也在这里和这里关注这些post 但是对于我的生活,我无法获得linkedin用户的电子邮件地址。 阅读这篇新帖后,我得到了一个新的应用程序,以获得新的密钥,但仍然没有运气。 通过这个 linkedinpost,但无法让它工作 我正在发布下面的代码,但是从我遵循的链接中大量提升 var credentials = new OAuthCredentials { CallbackUrl = “http://localhost:2715/Callback.aspx”, ConsumerKey = “my consumer key”,//not shown ConsumerSecret = “my consumer secret”,//not shown Type = OAuthType.RequestToken, }; var client = new RestClient { Authority = “https://api.linkedin.com/uas/oauth”, Credentials = credentials }; //var scope = HttpUtility.UrlEncode(“r_basicprofile r_emailaddress”); var request = new RestRequest […]

您必须将有效的JavaScript API域指定为此密钥配置的一部分。 在LinkedIn

我尝试使用带有回调选项的LinkedIn共享选项创建一个MVC4应用程序。 我用我的app id在我的Layout.cshtml中引用我的脚本。 api_key: APIkeyGOEShere function testme(count) { alert(“That document has been shared: ” + count + ” times”); } 但是萤火虫显示的信息如下图所示 但我相信我的AppID是正确的。 我不知道出现此错误的原因是什么。 编辑 我将api_key放在单引号内 api_key: ‘APIkeyGOEShere’ 但我在萤火虫中得到了一个不同的东西 错误:API密钥无效抛出新错误(“API密钥无效”); 任何格式都需要将API密钥放在javascript中。 请帮忙。

使用URI类时保持url编码

我正在尝试从LinkedIn获取公开个人资料信息。 要实现这一点,我必须提供 http://api.linkedin.com/v1/people/url=public-profile-url ,其中public-profile-url必须是URL编码的。 问题是,像HttpClient,WebRequest等.NET类使用Uri类,它似乎“封装”了提供的URL,因此我无法获得正确的格式化请求。 URI必须是: http://api.linkedin.com/v1/people/url=http%3a%2f%2fwww.linkedin.com%2fin%2fiftachragoler 但是: http://api.linkedin.com/v1/people/url=http://www.linkedin.com/in/iftachragoler 通过这种方式,我从LinkedIn收到’Bad Request’。 有什么方法可以让Uri / UriBuilder不解码该URL吗?