OAuth
class OAuth (View source)
The OAuth extension provides a simple interface to interact with data providers using the OAuth HTTP specification to protect private resources.
Properties
bool | $debug | ||
bool | $sslChecks | ||
array | $debugInfo |
Methods
Create a new OAuth object
Turn off verbose debugging
Turn off redirects
Turn off SSL checks
Turn on verbose debugging
Turn on redirects
Turn on SSL checks
Set the timeout
Fetch an OAuth-protected resource
Fetch an access token
Get CA information
Get the last response
Get headers for last response
Get HTTP information about the last response
Generate OAuth header string signature
Fetch a request token
Set authorization type
Set CA path and info
Set the nonce for subsequent requests
No description
Set the RSA certificate
Set the timestamp
Set the token and secret
Set the OAuth version
Details
__construct(string $consumer_key, string $consumer_secret, string $signature_method = OAUTH_SIG_METHOD_HMACSHA1, int $auth_type = OAUTH_AUTH_TYPE_AUTHORIZATION)
Create a new OAuth object
bool
disableDebug()
Turn off verbose debugging
void
disableRedirects()
Turn off redirects
bool
disableSSLChecks()
Turn off SSL checks
bool
enableDebug()
Turn on verbose debugging
bool
enableRedirects()
Turn on redirects
bool
enableSSLChecks()
Turn on SSL checks
void
setTimeout(int $timeout)
Set the timeout
mixed
fetch(string $protected_resource_url, array $extra_parameters = [], string $http_method = null, array $http_headers = [])
Fetch an OAuth-protected resource
array
getAccessToken(string $access_token_url, string $auth_session_handle = null, string $verifier_token = null)
Fetch an access token
array
getCAPath()
Get CA information
string
getLastResponse()
Get the last response
string|false
getLastResponseHeaders()
Get headers for last response
array
getLastResponseInfo()
Get HTTP information about the last response
string|false
getRequestHeader(string $http_method, string $url, mixed $extra_parameters = '')
Generate OAuth header string signature
array
getRequestToken(string $request_token_url, string $callback_url = null, string $http_method = 'GET')
Fetch a request token
bool
setAuthType(int $auth_type)
Set authorization type
mixed
setCAPath(string $ca_path = null, string $ca_info = null)
Set CA path and info
mixed
setNonce(string $nonce)
Set the nonce for subsequent requests
void
setRequestEngine(int $reqengine)
No description
mixed
setRSACertificate(string $cert)
Set the RSA certificate
mixed
setTimestamp(string $timestamp)
Set the timestamp
bool
setToken(string $token, string $token_secret)
Set the token and secret
bool
setVersion(string $version)
Set the OAuth version