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

 Methods

Simple Proxy to the current Zend_Oauth_Config method. It's that instance which holds all configuration methods and values this object also presents as it's API.

__call(string $method, array $args) : mixed

Parameters

$method

string

$args

array

Exceptions

\Zend_Oauth_Exception if method does not exist in config object

Returns

mixed

Constructor; create a new object with an optional array|Zend_Config instance containing initialising options.

__construct(array|\Zend_Config $options = null) : void

Parameters

$options

array\Zend_Config

Simple mechanism to delete the entire singleton HTTP Client instance which forces an new instantiation for subsequent requests.

clearHttpClient() : void
InheritedStatic

Retrieve an Access Token in exchange for a previously received/authorized Request Token.

getAccessToken(array $queryData, \Zend_Oauth_Token_Request $token, string $httpMethod = null, \Zend_Oauth_Http_AccessToken $request = null) : \Zend_Oauth_Token_Access

Parameters

$queryData

array

GET data returned in user's redirect from Provider

$token

$httpMethod

string

$request

\Zend_Oauth_Http_AccessToken

Exceptions

\Zend_Oauth_Exception on invalid authorization token, non-matching response authorization token, or unprovided authorization token

Returns

\Zend_Oauth_Token_Access

Return the singleton instance of the HTTP Client. Note that the instance is reset and cleared of previous parameters and Authorization header values.

getHttpClient() : \Zend_Http_Client
InheritedStatic

Returns

\Zend_Http_Client

Return whatever the last Access Token retrieved was while using the current Consumer instance.

getLastAccessToken() : \Zend_Oauth_Token_Access

Returns

\Zend_Oauth_Token_Access

Return whatever the last Request Token retrieved was while using the current Consumer instance.

getLastRequestToken() : \Zend_Oauth_Token_Request

Returns

\Zend_Oauth_Token_Request

After a Request Token is retrieved, the user may be redirected to the OAuth Provider to authorize the application's access to their protected resources - the redirect URL being provided by this method.

getRedirectUrl(null|array $customServiceParameters = null, null|\Zend_Oauth_Token_Request $token = null, null|\Zend_OAuth_Http_UserAuthorization $redirect = null) : string

Once the user has authorized the application for access, they are redirected back to the application which can now exchange the previous Request Token for a fully authorized Access Token.

Parameters

$customServiceParameters

nullarray

$token

null\Zend_Oauth_Token_Request

$redirect

null\Zend_OAuth_Http_UserAuthorization

Returns

string

Attempts to retrieve a Request Token from an OAuth Provider which is later exchanged for an authorized Access Token used to access the protected resources exposed by a web service API.

getRequestToken(null|array $customServiceParameters = null, null|string $httpMethod = null, null|\Zend_Oauth_Http_RequestToken $request = null) : \Zend_Oauth_Token_Request

Parameters

$customServiceParameters

nullarray

Non-OAuth Provider-specified parameters

$httpMethod

nullstring

$request

null\Zend_Oauth_Http_RequestToken

Returns

\Zend_Oauth_Token_Request

Alias to self::getLastAccessToken()

getToken() : \Zend_Oauth_Token_Access

Returns

\Zend_Oauth_Token_Access

Rather than retrieve a redirect URL for use, e.g. from a controller, one may perform an immediate redirect.

redirect(null|array $customServiceParameters = null, null|\Zend_Oauth_Token_Request $token = null, null|\Zend_Oauth_Http_UserAuthorization $request = null) : void

Sends headers and exit()s on completion.

Parameters

$customServiceParameters

nullarray

$token

null\Zend_Oauth_Token_Request

$request

null\Zend_Oauth_Http_UserAuthorization

Allows the external environment to make Zend_Oauth use a specific Client instance.

setHttpClient(\Zend_Http_Client $httpClient) : void
InheritedStatic

Parameters

$httpClient

\Zend_Http_Client

 Properties

 

$switcheroo

$switcheroo 

Default

false
 

Access token retrieved from OAuth Provider

$_accessToken : \Zend_Oauth_Token_Access

Default

null
 

$_config

$_config : \Zend_Oauth_Config

Default

null
 

Request Token retrieved from OAuth Provider

$_requestToken : \Zend_Oauth_Token_Request

Default

null
 

Singleton instance if required of the HTTP client

$httpClient : \Zend_Http_Client

Default

null
Static

 Constants

 

DELETE

DELETE = 'DELETE' 
 

GET

GET = 'GET' 
 

HEAD

HEAD = 'HEAD' 
 

OPTIONS

OPTIONS = 'OPTIONS' 
 

POST

POST = 'POST' 
 

PUT

PUT = 'PUT' 
 

REQUEST_SCHEME_HEADER

REQUEST_SCHEME_HEADER = 'header' 
 

REQUEST_SCHEME_POSTBODY

REQUEST_SCHEME_POSTBODY = 'postbody' 
 

REQUEST_SCHEME_QUERYSTRING

REQUEST_SCHEME_QUERYSTRING = 'querystring'