class JLinkedinOauth extends JOAuth1Client

Joomla Platform class for generating Linkedin API access token.

Methods

__construct( Registry $options = null, JHttp $client = null, JInput $input = null)

Constructor.

array
authenticate()

Method to for the oauth flow.

JHttpResponse
oauthRequest( string $url, string $method, array $parameters, mixed $data = array(), array $headers = array())

Method used to make an OAuth request.

void
validateResponse( string $url, JHttpResponse $response)

Method to validate a response.

string
toUrl( string $url, array $parameters)

Method to create the URL formed string with the parameters.

string
safeEncode( mixed $data)

Encodes the string or array passed in a way compatible with OAuth.

static  string
generateNonce()

Method used to generate the current nonce.

array
verifyCredentials()

Method to verify if the access token is valid by making a request to an API endpoint.

mixed
getOption( string $key)

Get an option from the JOauth1aClient instance.

setOption( string $key, mixed $value)

Set an option for the JOauth1aClient instance.

array
getToken()

Get the oauth token key or secret.

setToken( array $token)

Set the oauth token.

setScope( mixed $scope)

Method used to set permissions.

string
getScope()

Method to get the current scope

Details

__construct( Registry $options = null, JHttp $client = null, JInput $input = null)

Constructor.

Parameters

Registry $options OAuth1Client options object.
JHttp $client The HTTP client object.
JInput $input The input object

array authenticate()

Method to for the oauth flow.

Return Value

array Contains access token key, secret and verifier.

Exceptions

DomainException

JHttpResponse oauthRequest( string $url, string $method, array $parameters, mixed $data = array(), array $headers = array())

Method used to make an OAuth request.

Parameters

string $url The request URL.
string $method The request method.
array $parameters Array containing request parameters.
mixed $data The POST request data.
array $headers An array of name-value pairs to include in the header of the request

Return Value

JHttpResponse

Exceptions

DomainException

void validateResponse( string $url, JHttpResponse $response)

Method to validate a response.

Parameters

string $url The request URL.
JHttpResponse $response The response to validate.

Return Value

void

Exceptions

DomainException

string toUrl( string $url, array $parameters)

Method to create the URL formed string with the parameters.

Parameters

string $url The request URL.
array $parameters Array containing request parameters.

Return Value

string The formed URL.

string safeEncode( mixed $data)

Encodes the string or array passed in a way compatible with OAuth.

If an array is passed each array value will will be encoded.

Parameters

mixed $data The scalar or array to encode.

Return Value

string $data encoded in a way compatible with OAuth.

static string generateNonce()

Method used to generate the current nonce.

Return Value

string The current nonce.

array verifyCredentials()

Method to verify if the access token is valid by making a request to an API endpoint.

Return Value

array The decoded JSON response

mixed getOption( string $key)

Get an option from the JOauth1aClient instance.

Parameters

string $key The name of the option to get

Return Value

mixed The option value

JOAuth1Client setOption( string $key, mixed $value)

Set an option for the JOauth1aClient instance.

Parameters

string $key The name of the option to set
mixed $value The option value to set

Return Value

JOAuth1Client This object for method chaining

array getToken()

Get the oauth token key or secret.

Return Value

array The oauth token key and secret.

JOAuth1Client setToken( array $token)

Set the oauth token.

Parameters

array $token The access token key and secret.

Return Value

JOAuth1Client This object for method chaining.

JLinkedinOauth setScope( mixed $scope)

Method used to set permissions.

Parameters

mixed $scope String or an array of string containing permissions.

Return Value

JLinkedinOauth This object for method chaining

string getScope()

Method to get the current scope

Return Value

string String or an array of string containing permissions.