OAuth
in package
oAuth1.0 class.
Table of Contents
- HASH_ALGORITHM = 'SHA256'
- OAuth signature method algorithm.
- $apiVersion : string
- API version.
- $consumerKey : string
- Consumer key.
- $consumerSecret : string
- Consumer secret.
- $method : string
- Request method.
- $parameters : array<string|int, mixed>
- Request parameters.
- $timestamp : string
- Timestamp.
- $url : string
- API endpoint URL.
- __construct() : mixed
- Initialize oAuth class.
- getParameters() : string
- Get oAuth1.0 parameters.
- encode() : string
- Encode according to RFC 3986.
- generateOauthSignature() : string
- Generate oAuth1.0 signature.
- getSecret() : string
- Get secret.
- getSortedParameters() : array<string|int, mixed>
- Sort parameters.
- joinWithEqualsSign() : string
- Creates an array of urlencoded strings out of each array key/value pairs.
- normalizeParameters() : array<string|int, mixed>
- Normalize parameters.
- processFilters() : array<string|int, mixed>
- Process filters.
Constants
HASH_ALGORITHM
OAuth signature method algorithm.
public
mixed
HASH_ALGORITHM
= 'SHA256'
Properties
$apiVersion
API version.
protected
string
$apiVersion
$consumerKey
Consumer key.
protected
string
$consumerKey
$consumerSecret
Consumer secret.
protected
string
$consumerSecret
$method
Request method.
protected
string
$method
$parameters
Request parameters.
protected
array<string|int, mixed>
$parameters
$timestamp
Timestamp.
protected
string
$timestamp
$url
API endpoint URL.
protected
string
$url
Methods
__construct()
Initialize oAuth class.
public
__construct(string $url, string $consumerKey, string $consumerSecret, string $apiVersion, string $method[, array<string|int, mixed> $parameters = [] ][, string $timestamp = '' ]) : mixed
Parameters
- $url : string
-
Store URL.
- $consumerKey : string
-
Consumer key.
- $consumerSecret : string
-
Consumer Secret.
- $apiVersion : string
-
API version.
- $method : string
-
Request method.
- $parameters : array<string|int, mixed> = []
-
Request parameters.
- $timestamp : string = ''
-
Timestamp.
Return values
mixed —getParameters()
Get oAuth1.0 parameters.
public
getParameters() : string
Return values
string —encode()
Encode according to RFC 3986.
protected
encode(string|array<string|int, mixed> $value) : string
Parameters
- $value : string|array<string|int, mixed>
-
Value to be normalized.
Return values
string —generateOauthSignature()
Generate oAuth1.0 signature.
protected
generateOauthSignature(array<string|int, mixed> $parameters) : string
Parameters
- $parameters : array<string|int, mixed>
-
Request parameters including oauth.
Return values
string —getSecret()
Get secret.
protected
getSecret() : string
Return values
string —getSortedParameters()
Sort parameters.
protected
getSortedParameters(array<string|int, mixed> $parameters) : array<string|int, mixed>
Parameters
- $parameters : array<string|int, mixed>
-
Parameters to sort in byte-order.
Return values
array<string|int, mixed> —joinWithEqualsSign()
Creates an array of urlencoded strings out of each array key/value pairs.
protected
joinWithEqualsSign(array<string|int, mixed> $params[, array<string|int, mixed> $queryParams = [] ][, string $key = '' ]) : string
Parameters
- $params : array<string|int, mixed>
-
Array of parameters to convert.
- $queryParams : array<string|int, mixed> = []
-
Array to extend.
- $key : string = ''
-
Optional Array key to append
Return values
string —Array of urlencoded strings
normalizeParameters()
Normalize parameters.
protected
normalizeParameters(array<string|int, mixed> $parameters) : array<string|int, mixed>
Parameters
- $parameters : array<string|int, mixed>
-
Parameters to normalize.
Return values
array<string|int, mixed> —processFilters()
Process filters.
protected
processFilters(array<string|int, mixed> $parameters) : array<string|int, mixed>
Parameters
- $parameters : array<string|int, mixed>
-
Request parameters.