ashwinks / PHP-LinkedIn-SDK

A PHP wrapper for the LinkedIn API
94 stars 75 forks source link

getAccessToken gives 500 error #37

Open ghost opened 7 years ago

ghost commented 7 years ago

I initiate the class as stated in the readme file like

$li = new LinkedIn(
  array(
    'api_key' => 'yourapikey', 
    'api_secret' => 'yourapisecret', 
    'callback_url' => 'https://yourdomain.com/redirecthere'
  )
);
$url = $li->getLoginUrl
(
  array(
    LinkedIn::SCOPE_BASIC_PROFILE, 
    LinkedIn::SCOPE_EMAIL_ADDRESS, 
    LinkedIn::SCOPE_NETWORK
  )
);
$token = $li->getAccessToken($_REQUEST['code']);

the getAccessToken function gives a 500 error.

When I print out the contents of $li, it says "_access_token:LinkedIn\LinkedIn:private". Am I missing something?

WebAndCow commented 7 years ago

HI, try to add this in the $options of _makeRequest : CURLOPT_TIMEOUT => 5