Oauth/Http/RequestToken.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Oauth
- Version
- $Id: RequestToken.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Oauth_Http_RequestToken
- Parent(s)
- \Zend_Oauth_Http
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

string $_consumer = nullReference to the Zend_Oauth_Consumer instance in use.
Inherited from: \Zend_Oauth_Http::$$_consumernullDetails- Type
- string
- Inherited_from
- \Zend_Oauth_Http::$$_consumer

\Zend_Http_Client $_httpClient = nullSingleton instance if required of the HTTP client
nullDetails- Type
- \Zend_Http_Client

\Zend_Oauth_Http_Utility $_httpUtility = nullInstance of the general Zend_Oauth_Http_Utility class.
Inherited from: \Zend_Oauth_Http::$$_httpUtilitynullDetails- Type
- \Zend_Oauth_Http_Utility
- Inherited_from
- \Zend_Oauth_Http::$$_httpUtility

array $_parameters = array()Array of all custom service parameters to be sent in the HTTP request in addition to the usual OAuth parameters.
Inherited from: \Zend_Oauth_Http::$$_parametersarray()Details- Type
- array
- Inherited_from
- \Zend_Oauth_Http::$$_parameters

string $_preferredRequestMethod = \Zend_Oauth::POSTRequest Method for the HTTP Request.
Inherited from: \Zend_Oauth_Http::$$_preferredRequestMethod\Zend_Oauth::POSTDetails- Type
- string
- Inherited_from
- \Zend_Oauth_Http::$$_preferredRequestMethod

string $_preferredRequestScheme = nullOAuth 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.
Inherited from: \Zend_Oauth_Http::$$_preferredRequestSchemenullDetails- Type
- string
- Inherited_from
- \Zend_Oauth_Http::$$_preferredRequestScheme
Methods

__construct(\Zend_Oauth_Consumer $consumer, null | array $parameters = null, null | \Zend_Oauth_Http_Utility $utility = null) : void
| Name | Type | Description |
|---|---|---|
| $consumer | \Zend_Oauth_Consumer | |
| $parameters | null | array | |
| $utility | null | \Zend_Oauth_Http_Utility |

_assessRequestAttempt( $response = null) : voidManages the switch from OAuth request scheme to another lower preference scheme during a request cycle.
Inherited from: \Zend_Oauth_Http::_assessRequestAttempt()| Name | Type | Description |
|---|---|---|
| $response | Zend_Http_Response |
| Exception | Description |
|---|---|
| \Zend_Oauth_Exception | if unable to retrieve valid token response |

_attemptRequest(array $params) : \Zend_Http_ResponseAttempt a request based on the current configured OAuth Request Scheme and return the resulting HTTP Response.
| Name | Type | Description |
|---|---|---|
| $params | array |
| Type | Description |
|---|---|
| \Zend_Http_Response |

_toAuthorizationHeader(array $params, string $realm = null) : stringGenerates a valid OAuth Authorization header based on the provided parameters and realm.
Inherited from: \Zend_Oauth_Http::_toAuthorizationHeader()| Name | Type | Description |
|---|---|---|
| $params | array | |
| $realm | string |
| Type | Description |
|---|---|
| string |

assembleParams() : arrayAssemble all parameters for an OAuth Request Token request.
| Type | Description |
|---|---|
| array |

execute() : \Zend_Oauth_Token_RequestInitiate a HTTP request to retrieve a Request Token.
| Type | Description |
|---|---|
| \Zend_Oauth_Token_Request |

getParameters() : arrayAccessor for an array of custom parameters.
Inherited from: \Zend_Oauth_Http::getParameters()| Type | Description |
|---|---|
| array |

getRequestSchemeHeaderClient(array $params) : \Zend_Http_ClientGenerate and return a HTTP Client configured for the Header Request Scheme specified by OAuth, for use in requesting a Request Token.
| Name | Type | Description |
|---|---|---|
| $params | array |
| Type | Description |
|---|---|
| \Zend_Http_Client |

getRequestSchemePostBodyClient(array $params) : \Zend_Http_ClientGenerate and return a HTTP Client configured for the POST Body Request Scheme specified by OAuth, for use in requesting a Request Token.
| Name | Type | Description |
|---|---|---|
| $params | array |
| Type | Description |
|---|---|
| \Zend_Http_Client |

getRequestSchemeQueryStringClient(array $params, string $url) : \Zend_Http_ClientReturn an instance of Zend_Http_Client configured to use the Query String scheme for an OAuth driven HTTP request.
Inherited from: \Zend_Oauth_Http::getRequestSchemeQueryStringClient()| Name | Type | Description |
|---|---|---|
| $params | array | |
| $url | string |
| Type | Description |
|---|---|
| \Zend_Http_Client |

setMethod(string $method) : \Zend_Oauth_Http
| Name | Type | Description |
|---|---|---|
| $method | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Http |

setParameters(array $customServiceParameters) : \Zend_Oauth_HttpMutator to set an array of custom parameters for the HTTP request.
Inherited from: \Zend_Oauth_Http::setParameters()| Name | Type | Description |
|---|---|---|
| $customServiceParameters | array |
| Type | Description |
|---|---|
| \Zend_Oauth_Http |

startRequestCycle(array $params) : \Zend_Http_ResponseCommence 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.
Inherited from: \Zend_Oauth_Http::startRequestCycle()On success, return the Request object that results for processing.
| Name | Type | Description |
|---|---|---|
| $params | array |
| Type | Description |
|---|---|
| \Zend_Http_Response |
| Exception | Description |
|---|---|
| \Zend_Oauth_Exception | on HTTP request errors |