10 defined(
'JPATH_PLATFORM') or die();
39 $this->options = isset($options) ? $options :
new JRegistry;
41 $this->options->
def(
'accessTokenURL',
'https://www.linkedin.com/uas/oauth/accessToken');
42 $this->options->def(
'authenticateURL',
'https://www.linkedin.com/uas/oauth/authenticate');
43 $this->options->def(
'authoriseURL',
'https://www.linkedin.com/uas/oauth/authorize');
44 $this->options->def(
'requestTokenURL',
'https://www.linkedin.com/uas/oauth/requestToken');
47 parent::__construct($this->options, $client, $input);
57 public function verifyCredentials()
59 $token = $this->getToken();
63 'oauth_token' => $token[
'key']
66 $data[
'format'] =
'json';
69 $path =
'https://api.linkedin.com/v1/people::(~)';
72 $response = $this->oauthRequest($path,
'GET', $parameters, $data);
75 if ($response->code == 200)
96 public function validateResponse($url, $response)
98 if (!$code = $this->getOption(
'success_code'))
103 if (strpos($url,
'::(~)') ===
false && $response->code != $code)
105 if ($error = json_decode($response->body))
107 throw new DomainException(
'Error code ' . $error->errorCode .
' received with message: ' . $error->message .
'.');
111 throw new DomainException($response->body);
126 public function setScope($scope)
128 $this->setOption(
'scope', $scope);
140 public function getScope()
142 return $this->getOption(
'scope');