linkedin “this application is not allowed to create application tokens” [closed]

浪子不回头ぞ 提交于 2019-12-29 01:37:12

问题


My main problem is getting the token. I can’t go further than this step.

In the Linkedin API's docs there are two ways described to obtain the token. Witch is the correct one?

1) https://developer.linkedin.com/docs/v2/oauth2-client-credentials-flow 2) https://developer.linkedin.com/docs/oauth2#configure

I understand that in order to use the new Linkedin API (the partners one) I should use the first one (https://developer.linkedin.com/docs/v2/oauth2-client-credentials-flow)

Here is my petition:

https://www.linkedin.com/oauth/v2/accessToken?grant_type=client_credentials&client_id={MYCLIENTID}&client_secret={MYCLIENTSECRET}

The response: Error "access_denied" error_description "This application is not allowed to create application tokens"

And I get stuck here.

With the second one (https://developer.linkedin.com/docs/oauth2#configure) I actually get a token: https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id={MYCLIENTID}&redirect_uri={MYURIREDIRECT}&state={STATERETURNED}

This returns the code (and the State) which I use to make the token request:

https://www.linkedin.com/oauth/v2/accessToken?grant_type=authorization_code&client_id={MYCLIENTID}&client_secret={MYCLIENTSECRET}&redirect_uri={MYURIREDIRECT}&code={CODERETURNED}

And I get the token. But this isn’t the correct way to do it, is it?


回答1:


By default you will need to use the authorization_code flow to obtain an access token. Per the documentation the client_credentials flow is not enabled by default and needs to be specially enabled by LinkedIn.

https://developer.linkedin.com/docs/v2/oauth2-client-credentials-flow



来源:https://stackoverflow.com/questions/50626514/linkedin-this-application-is-not-allowed-to-create-application-tokens

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!