Is sign in with LinkedIn API CDN(https://platform.

2019-07-27 10:17发布

问题:

I'm using different NPM package of angular v6 for login with LinkedIn API.

But I'm facing one issue in every package. And even in last running website which was developed in JavaScript also throwing the same issue now. After debugging I found a problem in https://platform.linkedin.com/in.js.

Error is shown in the console as follows-

main.7cd16821a6fe05c4faf5.js:1 ERROR Error: Uncaught (in promise): TypeError: Cannot read property then of undefined
TypeError: Cannot read property then of undefined
at Object.authorize (in.js:18)

I've tried following angular packages-

 1. https://www.npmjs.com/package/angular-linkedin-sdk
 2. https://www.npmjs.com/package/angularx-social-login

Also tried to create raw javascript SDK project.

DEMO- https://abacritt.github.io/angularx-social-login/

So is it really API problem or is there any mistake from my end ? if yes then what is that?

If there are other ways to do sign with LinkedIn let me know those.

回答1:

LinkedIn no longer supports the JavaScript SDK. The recommended approach is to use OAuth 2.0 and LinkedIn's API.

Our JavaScript and Mobile Software Development Kits (SDKs) will stop working. Developers will need to migrate to using OAuth 2.0 directly from their apps.

https://engineering.linkedin.com/blog/2018/12/developer-program-updates



回答2:

Now we can't use JavaScript and Mobile Software Development Kits (SDKs)

as per the https://engineering.linkedin.com/blog/2018/12/developer-program-updates

Another way for the login with LinkedIn is LinkedIn Rest API with OAuth 2.0

Some useful links for implementation of LinkedIn Rest API with OAuth 2.0 -

  • http://shanalikhan.github.io/2015/09/02/OAuth-2.0-working-with-LinkedIn.html
  • https://medium.com/@ellesmuse/how-to-get-a-linkedin-access-token-a53f9b62f0ce