Source for file oauth.php
Documentation is available at oauth.php
* @package Joomla.Platform
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
defined('JPATH_PLATFORM') or die();
* Joomla Platform class for generating Linkedin API access token.
* @package Joomla.Platform
* @var JRegistry Options for the JLinkedinOauth object.
* @param JRegistry $options JLinkedinOauth options object.
* @param JHttp $client The HTTP client object.
* @param JInput $input The input object
public function __construct(JRegistry $options =
null, JHttp $client =
null, JInput $input =
null)
$this->options->def('accessTokenURL', 'https://www.linkedin.com/uas/oauth/accessToken');
$this->options->def('authenticateURL', 'https://www.linkedin.com/uas/oauth/authenticate');
$this->options->def('authoriseURL', 'https://www.linkedin.com/uas/oauth/authorize');
$this->options->def('requestTokenURL', 'https://www.linkedin.com/uas/oauth/requestToken');
// Call the JOauthV1aclient constructor to setup the object.
* Method to verify if the access token is valid by making a request to an API endpoint.
* @return boolean Returns true if the access token is valid and false otherwise.
'oauth_token' =>
$token['key']
$data['format'] =
'json';
$path =
'https://api.linkedin.com/v1/people::(~)';
$response =
$this->oauthRequest($path, 'GET', $parameters, $data);
if ($response->code ==
200)
* Method to validate a response.
* @param string $url The request URL.
* @param JHttpResponse $response The response to validate.
* @throws DomainException
if (!$code =
$this->getOption('success_code'))
if (strpos($url, '::(~)') ===
false &&
$response->code !=
$code)
throw
new DomainException('Error code ' .
$error->errorCode .
' received with message: ' .
$error->message .
'.');
throw
new DomainException($response->body);
* Method used to set permissions.
* @param mixed $scope String or an array of string containing permissions.
* @return JLinkedinOauth This object for method chaining
* @see https://developer.linkedin.com/documents/authentication
* Method to get the current scope
* @return string String or an array of string containing permissions.
Documentation generated on Tue, 19 Nov 2013 15:09:42 +0100 by phpDocumentor 1.4.3