The problem is that I can't get my userinfo from the Linkedin API. I always get not enough permission to access:
问题是我无法从Linkedin API获取我的用户信息。我总是没有足够的权限访问:
GET /userinfo - status 403
I tried to make an API call to get my LinkedIn Userinfo like Firstname.
我试图通过API调用来获取我的LinkedIn用户信息,比如FirstName。
I have an LinkedIn App and Dev Account. I do the authorization and getting accestoken manual in the searchbar. I just fill out the missing parameters. After that i try to make an API call in Postman with the acces token. The Authorization with the scope - profile worked and i got an accestoken. But when I try to make an API call to https://api.linkedin.com/v2/userinfo in Postman with the Access Token in the Authorization Bearer. I only get this response:
我有一个LinkedIn App和Dev帐户。我在搜索栏里做授权和获取登录手册。我只是填写了缺少的参数。之后,我尝试使用acces令牌在Postman中进行API调用。使用作用域配置文件的授权起作用了,我得到了一个访问标记。但是,当我尝试使用授权载体中的访问令牌对Postman中的https://api.linkedin.com/v2/userinfo进行API调用时。我只得到这样的回应:
"serviceErrorCode": 100,
"message": "Not enough permissions to access: GET /userinfo",
"status": 403"
I only have the consumer free product - so I got share on LinkedIn and sign in with openid connect.
我只有消费者免费的产品--所以我在LinkedIn上获得了分享,并使用OpenID Connect登录。
Still I don't know why I cannot get my profile information.
Can someone tell me what im doing wrong after getting the accesstoken?
Is there a better way to try to make an API call for userinfo? Or do i need other products and permissions?
Thanks for Help :)
我仍然不知道为什么我无法获得我的个人资料信息。有人能告诉我拿到通行证后我做错了什么吗?有没有更好的方法来尝试对用户信息进行API调用?或者,我是否需要其他产品和权限?感谢您的帮助:)
更多回答
优秀答案推荐
You get this error because you don't have access to the "openid" scope. There are two steps:
你得到这个错误,因为你没有访问“openid”范围。有两个步骤:
1 - Get the authorization for that scope on your LinkedIn Developer Account by requesting the product " Sign In with LinkedIn using OpenID Connect". When this is done you should see this in the "Auth" tab:
1 -通过请求产品“使用OpenID Connect登录LinkedIn”,在您的LinkedIn开发者帐户上获得该范围的授权。完成此操作后,您应该在“Auth”选项卡中看到以下内容:
2 - When you make a request to "https://www.linkedin.com/oauth/v2/authorization", "openid" should be one of the value of the scope parameter. (Scopes are separated by a space if you want to add several ones). So you the url would like https://www.linkedin.com/oauth/v2/authorization?scope=openid&...
2-当您向“https://www.linkedin.com/oauth/v2/authorization”,发出请求时,“OpenID”应该是Scope参数的值之一。(如果要添加多个作用域,则用空格分隔)。所以你的URL想要https://www.linkedin.com/oauth/v2/authorization?scope=openid&...
Provided that you have completed both steps you can then make the same request you are making to the "userinfo" endpoint with your token and it should work.
假设您已经完成了这两个步骤,那么您可以使用令牌向“userinfo”端点发出相同的请求,并且它应该可以工作。
更多回答
我是一名优秀的程序员,十分优秀!