Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linkedin v2 Api #18

Open
umardraz opened this issue Jul 23, 2019 · 2 comments
Open

Linkedin v2 Api #18

umardraz opened this issue Jul 23, 2019 · 2 comments

Comments

@umardraz
Copy link

Hi

'linkedin' => array(
        'authoauth2:LinkedInV2Auth',
        'clientId' => '2KodETR7hsnp80al',
        'clientSecret' => 'ADFlKzKmk3UacdfTYU',
        'scopes' => ['r_liteprofile', 'r_emailaddress']
)

The above is my authsource.php settings for linkedin authentication, it working fine but only giving me these attributes

linkedin.id, linkedin.firstName, linkedin.lastName and linkedin.emailAddress

Would you please tell me how I can get

linkedin.location.name, linkedin.publicProfileUrl, and linkedin.pictureUrl

@pradtke
Copy link
Contributor

pradtke commented Jul 23, 2019

I think you'll need to review the LinkedIn documentation to determine what the correct scope is to use (r_liteprofile or r_basicprofile) and then adjust the scopes you configure for the module . You'll also need to set urlResourceOwnerOptions to the query params that LinkedIn expects to request the attributes you want. urlResourceOwnerOptions is an array of queryParam => value. If you need to make additional API calls to LinkedIn then you can subclass LinkedInV2Auth and override the postFinalStep method to make additional API calls with the access token.

@umardraz
Copy link
Author

Hi

Already had this in ConfigTemplate.php

urlResourceOwnerDetails' => 'https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture(displayImage~:playableStreams))',

I think ProfileAttribue is missing in thiis authoauth2 plugin so I had modified LinkedinV2Auth.php and added this code

 $attributes = [
            $prefix . "id" => [$resourceOwnerAttributes["id"]],
            $prefix . "pictureUrl" => [$resourceOwnerAttributes["profilePicture"]['displayImage~']['elements'][0]['identifiers'][0]['identifier']]
        ];

Don't know this is the correct way or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants