|
| __construct (Registry $options=null, JHttp $client=null, JInput $input=null, JApplicationWeb $application=null, $version=null) |
|
| authenticate () |
|
| oauthRequest ($url, $method, $parameters, $data=array(), $headers=array()) |
|
| validateResponse ($url, $response) |
|
| toUrl ($url, $parameters) |
|
| safeEncode ($data) |
|
| verifyCredentials () |
|
| getOption ($key) |
|
| setOption ($key, $value) |
|
| getToken () |
|
| setToken ($token) |
|
Joomla Platform class for interacting with an OAuth 1.0 and 1.0a server.
- Depuis
- 3.2.0
- Obsolète:
- 4.0 Use the
joomla/oauth1
framework package that will be bundled instead
◆ __construct()
Constructor.
- Paramètres
-
Registry | $options | OAuth1Client options object. |
JHttp | $client | The HTTP client object. |
JInput | $input | The input object |
JApplicationWeb | $application | The application object |
string | $version | Specify the OAuth version. By default we are using 1.0a. |
- Depuis
- 3.2.0
Références $client, $input, $options, et $version.
◆ _authorise()
Method used to authorise the application.
- Renvoie
- void
- Depuis
- 3.2.0
Références $url.
◆ _baseString()
_baseString |
( |
|
$url, |
|
|
|
$method, |
|
|
|
$parameters |
|
) |
| |
|
private |
Prepare the signature base string.
- Paramètres
-
string | $url | The URL to sign. |
string | $method | The request method. |
array | $parameters | Array containing request parameters. |
- Renvoie
- string The base string.
- Depuis
- 3.2.0
Références $base, $key, $parameters, $params, $url, et $value.
◆ _createHeader()
_createHeader |
( |
|
$parameters | ) |
|
|
private |
Method used to create the header for the POST request.
- Paramètres
-
array | $parameters | Array containing request parameters. |
- Renvoie
- string The header.
- Depuis
- 3.2.0
Références $key, $parameters, et $value.
◆ _generateAccessToken()
Method used to get an access token.
- Renvoie
- void
- Depuis
- 3.2.0
Références $parameters, et $params.
◆ _generateRequestToken()
_generateRequestToken |
( |
| ) |
|
|
private |
Method used to get a request token.
- Renvoie
- void
- Depuis
- 3.2.0
- Exceptions
-
Références $parameters, et $params.
◆ _prepareSigningKey()
Prepares the OAuth signing key.
- Renvoie
- string The prepared signing key.
- Depuis
- 3.2.0
◆ _signRequest()
_signRequest |
( |
|
$url, |
|
|
|
$method, |
|
|
|
$parameters |
|
) |
| |
|
private |
Method used to sign requests.
- Paramètres
-
string | $url | The URL to sign. |
string | $method | The request method. |
array | $parameters | Array containing request parameters. |
- Renvoie
- array
- Depuis
- 3.2.0
Références $base, $parameters, et $url.
◆ authenticate()
Method to for the oauth flow.
- Renvoie
- array Contains access token key, secret and verifier.
- Depuis
- 3.2.0
- Exceptions
-
Références null.
◆ generateNonce()
Method used to generate the current nonce.
- Renvoie
- string The current nonce.
- Depuis
- 3.2.0
◆ getOption()
Get an option from the JOauth1aClient instance.
- Paramètres
-
string | $key | The name of the option to get |
- Renvoie
- mixed The option value
- Depuis
- 3.2.0
Références $key.
◆ getToken()
Get the oauth token key or secret.
- Renvoie
- array The oauth token key and secret.
- Depuis
- 3.2.0
◆ oauthRequest()
oauthRequest |
( |
|
$url, |
|
|
|
$method, |
|
|
|
$parameters, |
|
|
|
$data = array() , |
|
|
|
$headers = array() |
|
) |
| |
Method used to make an OAuth request.
- Paramètres
-
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 |
- Renvoie
- JHttpResponse
- Depuis
- 3.2.0
- Exceptions
-
Références $data, $parameters, et $url.
◆ safeEncode()
Encodes the string or array passed in a way compatible with OAuth. If an array is passed each array value will will be encoded.
- Paramètres
-
mixed | $data | The scalar or array to encode. |
- Renvoie
- string $data encoded in a way compatible with OAuth.
- Depuis
- 3.2.0
Références $data, et elseif.
◆ setOption()
setOption |
( |
|
$key, |
|
|
|
$value |
|
) |
| |
Set an option for the JOauth1aClient instance.
- Paramètres
-
string | $key | The name of the option to set |
mixed | $value | The option value to set |
- Renvoie
- JOAuth1Client This object for method chaining
- Depuis
- 3.2.0
Références $key, et $value.
◆ setToken()
Set the oauth token.
- Paramètres
-
array | $token | The access token key and secret. |
- Renvoie
- JOAuth1Client This object for method chaining.
- Depuis
- 3.2.0
◆ toUrl()
toUrl |
( |
|
$url, |
|
|
|
$parameters |
|
) |
| |
Method to create the URL formed string with the parameters.
- Paramètres
-
string | $url | The request URL. |
array | $parameters | Array containing request parameters. |
- Renvoie
- string The formed URL.
- Depuis
- 3.2.0
Références $key, $parameters, $url, et $value.
◆ validateResponse()
validateResponse |
( |
|
$url, |
|
|
|
$response |
|
) |
| |
|
abstract |
Method to validate a response.
- Paramètres
-
string | $url | The request URL. |
JHttpResponse | $response | The response to validate. |
- Renvoie
- void
- Depuis
- 3.2.0
- Exceptions
-
◆ verifyCredentials()
Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not.
- Renvoie
- array The decoded JSON response
- Depuis
- 3.2.0
◆ $application
◆ $client
◆ $input
◆ $options
◆ $token
◆ $version
La documentation de cette classe a été générée à partir du fichier suivant :