简体   繁体   English

“没有足够的权限访问:GET-members / emailAddress”-C#,RestSharp,Postman,LinkedIn API

[英]“Not enough permissions to access: GET-members /emailAddress” - C#, RestSharp, Postman, LinkedIn API

I'm attempting to access the LinkedIn API's so I can post some text to a page via c# but I'm running into the titled error when attempting to retrieve the user handle. 我正在尝试访问LinkedIn API,因此我可以通过c#将一些文本发布到页面上,但是在尝试检索用户句柄时遇到标题错误。

I've followed the guides that have me set up an application, verify that application, get the auth code (approved), get an access token, and now I"m stuck on retrieving the handle. 我遵循了指导我设置应用程序,验证该应用程序,获取auth代码(已批准),获取访问令牌的指南,现在我被困在检索句柄上。

I've tried using both the liteprofile and the basic profile. 我尝试使用liteprofile和基本配置文件。 Whenever I attempt to use the liteprofile I get the "unauthorized_scope_error" message in my redirect url. 每当我尝试使用liteprofile时,我的重定向URL中都会出现“ unauthorized_scope_error”消息。 When I use the basicprofile I get the authorization code but then run into the permission error. 当我使用basicprofile时,我获得了授权代码,但随后遇到了权限错误。

I've also been reading about how liteprofile is the profile that "should" be used right now but that it also has its disadvantages. 我还一直在阅读liteprofile是如何“现在”使用的配置文件,但是它也有其缺点。

I'll try to add some code while also removing some of the personal stuff (the removed code will be in {}). 我将尝试添加一些代码,同时还要删除一些个人内容(删除的代码将在{}中)。

Here's my Postman GET that gives me a successful redirect and auth code: 这是我的邮递员GET,可为我提供成功的重定向和身份验证代码:

    GET https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id={client_id}&redirect_uri=https://www.linkedin.com/company/{removed}/admin/&state=fooobar&scope=r_basicprofile%20r_emailaddress%20

Here's my POST (using the auth code from the previous GET) to retrieve my access token: 这是我的POST(使用先前GET中的身份验证代码)来检索我的访问令牌:

    POST https://www.linkedin.com/oauth/v2/accessToken?grant_type=authorization_code&code={code}&redirect_uri={redirect_url}&client_id={client_id}&client_secret={client_secret}

Here's my Postman GET that should be giving me the handle but instead is returning the error: 这是我的邮递员GET应该给我的句柄,但返回错误:

GET https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))&oauth2_access_token={access_token}

And the error: 错误:

{
"serviceErrorCode": 100,
"message": "Not enough permissions to access: GET-members /emailAddress",
"status": 403
}

I would like to get the handle for the linked in page but instead I'm receiving the titled error message in the response body. 我想获取链接页面的句柄,但我在响应正文中收到标题为错误的消息。

Issue with oAuth 2.0 LinkedIn Upgrade API Web Service it Seems. 似乎是oAuth 2.0 LinkedIn升级API Web服务问题。

Please refer this 请参考这个

https://github.com/laravel/socialite/pull/310 https://github.com/laravel/socialite/pull/310

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM