category Zend
package Zend_Oauth
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Oauth_Http

 Methods

Constructor

__construct(\Zend_Oauth_Consumer $consumer, null|array $parameters = null, null|\Zend_Oauth_Http_Utility $utility = null) : void
Inherited

Parameters

$consumer

\Zend_Oauth_Consumer

$parameters

nullarray

$utility

null\Zend_Oauth_Http_Utility

Assemble all parameters for an OAuth Access Token request.

assembleParams() : array

Returns

array

Initiate a HTTP request to retrieve an Access Token.

execute() : \Zend_Oauth_Token_Access

Returns

\Zend_Oauth_Token_Access

Return the Consumer instance in use.

getConsumer() : \Zend_Oauth_Consumer
Inherited

Returns

\Zend_Oauth_Consumer

Preferred HTTP request method accessor.

getMethod() : string
Inherited

Returns

string

Accessor for an array of custom parameters.

getParameters() : array
Inherited

Returns

array

Generate and return a HTTP Client configured for the Header Request Scheme specified by OAuth, for use in requesting an Access Token.

getRequestSchemeHeaderClient(array $params) : \Zend_Http_Client

Parameters

$params

array

Returns

\Zend_Http_Client

Generate and return a HTTP Client configured for the POST Body Request Scheme specified by OAuth, for use in requesting an Access Token.

getRequestSchemePostBodyClient(array $params) : \Zend_Http_Client

Parameters

$params

array

Returns

\Zend_Http_Client

Generate and return a HTTP Client configured for the Query String Request Scheme specified by OAuth, for use in requesting an Access Token.

getRequestSchemeQueryStringClient(array $params, string $url) : \Zend_Http_Client
inherited_from \Zend_Oauth_Http::getRequestSchemeQueryStringClient()

Parameters

$params

array

$url

string

Returns

\Zend_Http_Client

Return an instance of Zend_Http_Client configured to use the Query String scheme for an OAuth driven HTTP request.

getRequestSchemeQueryStringClient(array $params, string $url) : \Zend_Http_Client
Inherited

Parameters

$params

array

$url

string

Returns

\Zend_Http_Client

Set a preferred HTTP request method.

setMethod(string $method) : \Zend_Oauth_Http
Inherited

Parameters

$method

string

Returns

\Zend_Oauth_Http

Mutator to set an array of custom parameters for the HTTP request.

setParameters(array $customServiceParameters) : \Zend_Oauth_Http
Inherited

Parameters

$customServiceParameters

array

Returns

\Zend_Oauth_Http

Commence a request cycle where the current HTTP method and OAuth request scheme set an upper preferred HTTP request style and where failures generate a new HTTP request style further down the OAuth preference list for OAuth Request Schemes.

startRequestCycle(array $params) : \Zend_Http_Response
Inherited

On success, return the Request object that results for processing.

todo Remove cycling?; Replace with upfront do-or-die configuration

Parameters

$params

array

Exceptions

\Zend_Oauth_Exception on HTTP request errors

Returns

\Zend_Http_Response

Manages the switch from OAuth request scheme to another lower preference scheme during a request cycle.

_assessRequestAttempt(\Zend_Http_Response $response = null) : void
Inherited

Parameters

$response

Exceptions

\Zend_Oauth_Exception if unable to retrieve valid token response

Attempt a request based on the current configured OAuth Request Scheme and return the resulting HTTP Response.

_attemptRequest(array $params) : \Zend_Http_Response

Parameters

$params

array

Returns

\Zend_Http_Response

Access Token requests specifically may not contain non-OAuth parameters.

_cleanParamsOfIllegalCustomParameters(array $params) : array

So these should be striped out and excluded. Detection is easy since specified OAuth parameters start with "oauth", Extension params start with "xouth", and no other parameters should use these prefixes.

xouth params are not currently allowable.

Parameters

$params

array

Returns

array

Generates a valid OAuth Authorization header based on the provided parameters and realm.

_toAuthorizationHeader(array $params, string $realm = null) : string
Inherited

Parameters

$params

array

$realm

string

Returns

string

 Properties

 

Reference to the Zend_Oauth_Consumer instance in use.

$_consumer : string

Default

null
 

Singleton instance if required of the HTTP client

$_httpClient : \Zend_Http_Client

Default

null
 

Instance of the general Zend_Oauth_Http_Utility class.

$_httpUtility : \Zend_Oauth_Http_Utility

Default

null
 

Array of all custom service parameters to be sent in the HTTP request in addition to the usual OAuth parameters.

$_parameters : array

Default

array()
 

Request Method for the HTTP Request.

$_preferredRequestMethod : string

Default

\Zend_Oauth::POST
 

OAuth specifies three request methods, this holds the current preferred one which by default uses the Authorization Header approach for passing OAuth parameters, and a POST body for non-OAuth custom parameters.

$_preferredRequestScheme : string

Default

null