I am using the Developers API with an App I created in LinkedIn.
When I call this method to sign in.....
IN.UI.Authorize().params({ "scope": ["r_liteprofile", "r_emailaddress"] }).place()
a Window begins to open and I get this error message:
Unhandled exception at line 7, column 56783 in http://platform.linkedin.com/in.js 0x800a139e - JavaScript runtime error: [Messenger] Required property 'target' was not provided occurred
I have completed LinkedIn's App Setup, but can't figure what could be causing this. My JavaScript code is below:
[script type="text/javascript" src="//platform.linkedin.com/in.js"] api_key: 'xxxxx......xxxxx' authorize: true [/script] function LinkedInSignIn() { IN.UI.Authorize().params({ "scope": ["r_liteprofile", "r_emailaddress"] }).place(); IN.Event.on(IN, 'auth', getProfileData); } function getProfileData() { // Use the API call wrapper to request the member's basic profile data IN.API.Profile("me").fields("id,firstName,lastName,email-address,picture-urls::(original),public-profile-url,location:(name)").result(function (me) { var profile = me.values[0]; var id = profile.id; alert(profile.firstName); }); }
As it turned out, the reason this is not working is becuase LinkedIn discontinued it at the end of 2018. Contacting LinkIn's support wasn't much help either. They only said they do no support thier code library and referred my back here to StackOverflow.
For anyone having the same problem, the solutions is to use Oauth2, which is documented at:
https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/context
Happy Coding!
Graham