JOAuth2Client

Joomla Platform class for interacting with an OAuth 2.0 server.

deprecated
since

3.1.4

deprecated

4.0 Use the joomla/oauth2 framework package that will be bundled instead

package

Joomla.Platform

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry $options = null, \JHttp $http = null, \JInput $input = null, \JApplicationWeb $application = null) 
since

3.1.4

Arguments

$options

\Joomla\Registry\RegistryJOAuth2Client options object

$http

\JHttpThe HTTP client object

$input

\JInputThe input object

$application

\JApplicationWebThe application object

authenticate

Get the access token or redict to the authentication URL.

authenticate() : string
since

3.1.4

throws

\RuntimeException

Response

stringThe access token

createUrl

Create the URL for authentication.

createUrl() : \JHttpResponse
since

3.1.4

throws

\InvalidArgumentException

Response

\JHttpResponseThe HTTP response

getOption

Get an option from the JOAuth2Client instance.

getOption(string $key) : mixed
since

3.1.4

Arguments

$key

stringThe name of the option to get

Response

mixedThe option value

getToken

Get the access token from the JOAuth2Client instance.

getToken() : array
since

3.1.4

Response

arrayThe access token

isAuthenticated

Verify if the client has been authenticated

isAuthenticated() : boolean
since

3.1.4

Response

booleanIs authenticated

query

Send a signed Oauth request.

query(string $url, mixed $data = null, array $headers = array(), string $method = 'get', integer $timeout = null) : string
since

3.1.4

throws

\InvalidArgumentException

\RuntimeException

Arguments

$url

stringThe URL for the request.

$data

mixedThe data to include in the request

$headers

arrayThe headers to send with the request

$method

stringThe method with which to send the request

$timeout

integerThe timeout for the request

Response

stringThe URL.

refreshToken

Refresh the access token instance.

refreshToken(string $token = null) : array
since

3.1.4

throws

\Exception

\RuntimeException

Arguments

$token

stringThe refresh token

Response

arrayThe new access token

setOption

Set an option for the JOAuth2Client instance.

setOption(string $key, mixed $value) : \JOAuth2Client
since

3.1.4

Arguments

$key

stringThe name of the option to set

$value

mixedThe option value to set

Response

\JOAuth2ClientThis object for method chaining

setToken

Set an option for the JOAuth2Client instance.

setToken(array $value) : \JOAuth2Client
since

3.1.4

Arguments

$value

arrayThe access token

Response

\JOAuth2ClientThis object for method chaining

Properties

options

Options for the JOAuth2Client object.

since

3.1.4

Type(s)

\Joomla\Registry\Registry

http

The HTTP client object to use in sending HTTP requests.

since

3.1.4

Type(s)

\JHttp

input

The input object to use in retrieving GET/POST data.

since

3.1.4

Type(s)

\JInput

application

The application object to send HTTP headers for redirects.

since

3.1.4

Type(s)

\JApplicationWeb