LinkedIn V2 api: 权限不足,无法访问 /me GET

LinkedIn V2 api: Not enough permissions to access /me GET

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

但是每次我使用令牌并进行查询时,我都会得到一个错误:

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

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

LinkedIn API 已 largely closed off and is only available to approved LinkedIn developers. You can request authorisation here: https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner/marketing-developer-program

这是一个老问题,但是解决方案是在授权的第一步中使用范围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' \

在此处找到解决方案:

如果您正在使用 https://oauth.io/,则必须在 密钥和权限范围 配置页面中添加范围: