【问题标题】:LinkedIn V2 api: Not enough permissions to access /me GETLinkedIn V2 api:没有足够的权限访问 /me GET
【发布时间】:2018-02-19 07:52:56
【问题描述】:

我一直在尝试使用linkedin V2 api,但不断出错。 我创建了一个开发者应用程序。将重定向 url 设置为“https://www.getpostman.com/oauth2/callback”以使用邮递员发出请求(根据邮递员文档)。 填写表单以请求访问令牌。

但每次我使用令牌并进行查询时,都会出现错误:

但我在我的应用程序中选择了所有默认应用程序权限。我错过了什么吗?

【问题讨论】:

    标签: linkedin-api


    【解决方案1】:

    LinkedIn API 为 largely closed off,仅对已获批准的 LinkedIn 开发人员可用。您可以在这里申请授权:https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner/marketing-developer-program

    【讨论】:

    • 我只想实现注册。我还需要在那里申请吗?
    • r_basicprofile 理论上应该无需请求正式授权即可访问。 docs.microsoft.com/en-us/linkedin/shared/references/v2/profile/… 但是,即使在用户授予r_basicprofile 之后,许多字段对我也不起作用。
    • @Sinister Beard,如果我们只需要使用 OAuth2 基本配置文件,则没有任何理由请求此授权 - 在我的情况下,只有电子邮件地址。 LinkedIn 用户指南中没有任何内容建议开发者这样做。
    • @mpoletto 不,没有 - 但那是缺少文档。
    • @mpoletto developer.linkedin.com/blog/posts/2015/… - 我也会将此添加到我的答案中。
    【解决方案2】:

    这是一个老问题,但解决方案是在授权的第一步使用范围 r_liteProfile 而不是 r_basicprofile。

    https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=*****&redirect_uri=http://yourauthorizationserver&state=RandomString&scope=r_liteprofile
    

    然后,使用第二步授权时LinkedIn传回http://yourauthorizationserver的code参数值:

    curl -X POST \
    'https://www.linkedin.com/oauth/v2/accessToken?code=codeobtainedwiththefirstcall&grant_type=authorization_code&client_secret=*****&client_id=***&redirect_uri=yourredirecturi' \
    

    在这里找到的解决方案: Any queries to the api.linkedin.com/v2/ return "Not enough permissions to access ..."

    【讨论】:

    • 非常感谢!
    【解决方案3】:

    您是否检查并允许访问“r_basicprofile”权限?转到您的应用程序并检查 people/~/me 端点的默认应用程序权限。

    【讨论】:

    • 即使有该权限,它似乎也不起作用。 LinkedIn现在完全关闭。我们都应该停止使用它。
    【解决方案4】:

    如果您使用https://oauth.io/,则必须在Keys and Permission Scope配置页面中添加范围:

    【讨论】:

      猜你喜欢
      • 2019-06-02
      • 1970-01-01
      • 2019-05-13
      • 1970-01-01
      • 2019-02-27
      • 2019-11-15
      • 1970-01-01
      • 2020-01-19
      • 1970-01-01
      相关资源
      最近更新 更多