Skip to content

Commit

Permalink
[5.x.x] Update LinkedInProvider.php
Browse files Browse the repository at this point in the history
  • Loading branch information
moha-ep authored Oct 24, 2023
1 parent a68f3fd commit fb3438a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Two/LinkedInProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,19 @@ protected function getUserByToken($token)
* @return array
*/
protected function getBasicProfile($token)
{
{
$fields = ["id","firstName","lastName","profilePicture(displayImage~:playableStreams)"];

if(in_array('r_liteprofile', $this->getScopes())){
array_push($fields, 'vanityName');
}
$response = $this->getHttpClient()->get('https://api.linkedin.com/v2/me', [
RequestOptions::HEADERS => [
'Authorization' => 'Bearer '.$token,
'X-RestLi-Protocol-Version' => '2.0.0',
],
RequestOptions::QUERY => [
'projection' => '(id,firstName,lastName,profilePicture(displayImage~:playableStreams))',
'projection' => "(".implode(',',$fields).")",
],
]);

Expand Down

0 comments on commit fb3438a

Please sign in to comment.