Client
Joomla Framework class for interacting with an OAuth 2.0 server.
since |
1.0 |
---|---|
package |
Joomla Framework |
Methods
__construct
Constructor.
__construct(array|\ArrayAccess options = [], \Joomla\Http\Http http = null, \Joomla\Input\Input input = null, \Joomla\Application\WebApplicationInterface application = null) : mixed
since |
1.0 |
---|
Arguments
- options
array|\ArrayAccess
OAuth2 Client options object- http
\Joomla\Http\Http
The HTTP client object- input
\Joomla\Input\Input
The input object- application
\Joomla\Application\WebApplicationInterface
The application object
Response
mixed
authenticate
Get the access token or redirect to the authentication URL.
authenticate() : array|bool
since |
1.0 |
---|---|
throws |
|
Response
array|bool
The access token or false on failure
createUrl
Create the URL for authentication.
createUrl() : string
since |
1.0 |
---|---|
throws |
|
Response
string
getOption
Get an option from the OAuth2 Client instance.
getOption(string key, mixed default = null) : mixed
since |
1.0 |
---|
Arguments
- key
string
The name of the option to get- default
mixed
Optional default value, returned if the requested option does not exist.
Response
mixed
The option value
getToken
Get the access token from the Client instance.
getToken() : array
since |
1.0 |
---|
Response
array
The access token
isAuthenticated
Verify if the client has been authenticated
isAuthenticated() : bool
since |
1.0 |
---|
Response
bool
Is authenticated
query
Send a signed OAuth request.
query(string url, mixed data = null, array headers = [], string method = 'get', int timeout = null) : \Joomla\Http\Response
since |
1.0 |
---|---|
throws |
|
Arguments
- url
string
The URL for the request- data
mixed
Either an associative array or a string to be sent with the request- headers
array
The headers to send with the request- method
string
The method with which to send the request- timeout
int
The timeout for the request
Response
\Joomla\Http\Response
refreshToken
Refresh the access token instance.
refreshToken(string token = null) : array
since |
1.0 |
---|---|
throws |
|
Arguments
- token
string
The refresh token
Response
array
The new access token
setOption
Set an option for the OAuth2 Client instance.
setOption(string key, mixed value) : \Joomla\OAuth2\Client
since |
1.0 |
---|
Arguments
- key
string
The name of the option to set- value
mixed
The option value to set
Response
\Joomla\OAuth2\Client
This object for method chaining
setToken
Set an option for the Client instance.
setToken(array value) : \Joomla\OAuth2\Client
since |
1.0 |
---|
Arguments
- value
array
The access token
Response
\Joomla\OAuth2\Client
This object for method chaining
Properties
options
Options for the Client object.
since |
1.0 |
---|
Type(s)
array|\ArrayAccess
http
The HTTP client object to use in sending HTTP requests.
since |
1.0 |
---|
Type(s)
\Joomla\Http\Http
input
The input object to use in retrieving GET/POST data.
since |
1.0 |
---|
Type(s)
\Joomla\Input\Input
application
The application object to send HTTP headers for redirects.
since |
1.0 |
---|
Type(s)
\Joomla\Application\WebApplicationInterface