Oauth/Consumer.php

Show: PublicProtectedPrivateinherited
Table of Contents
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 license@zend.com 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: Consumer.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Oauth_Consumer

Package: Zend\Oauth
Parent(s)
\Zend_Oauth
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  REQUEST_SCHEME_HEADER = 'header'
inheritedInherited from: \Zend_Oauth::REQUEST_SCHEME_HEADER
>VConstant  REQUEST_SCHEME_POSTBODY = 'postbody'
inheritedInherited from: \Zend_Oauth::REQUEST_SCHEME_POSTBODY
>VConstant  REQUEST_SCHEME_QUERYSTRING = 'querystring'
>VConstant  GET = 'GET'
inheritedInherited from: \Zend_Oauth::GET
Inherited_from
\Zend_Oauth::GET  
>VConstant  POST = 'POST'
inheritedInherited from: \Zend_Oauth::POST
Inherited_from
\Zend_Oauth::POST  
>VConstant  PUT = 'PUT'
inheritedInherited from: \Zend_Oauth::PUT
Inherited_from
\Zend_Oauth::PUT  
>VConstant  DELETE = 'DELETE'
inheritedInherited from: \Zend_Oauth::DELETE
Inherited_from
\Zend_Oauth::DELETE  
>VConstant  HEAD = 'HEAD'
inheritedInherited from: \Zend_Oauth::HEAD
Inherited_from
\Zend_Oauth::HEAD  
>VConstant  OPTIONS = 'OPTIONS'
inheritedInherited from: \Zend_Oauth::OPTIONS
Inherited_from
\Zend_Oauth::OPTIONS  

Properties

>VPropertyprotected\Zend_Oauth_Token_Access $_accessToken = null
Access token retrieved from OAuth Provider
Default valuenullDetails
Type
\Zend_Oauth_Token_Access
>VPropertyprotected\Zend_Oauth_Config $_config = null
Default valuenullDetails
Type
\Zend_Oauth_Config
>VPropertyprotected\Zend_Oauth_Token_Request $_requestToken = null
Request Token retrieved from OAuth Provider
Default valuenullDetails
Type
\Zend_Oauth_Token_Request
>VPropertyprotected\Zend_Http_Client $httpClient = null
staticinherited
Singleton instance if required of the HTTP client
Inherited from: \Zend_Oauth::$$httpClient
Default valuenullDetails
Type
\Zend_Http_Client
Inherited_from
\Zend_Oauth::$$httpClient  
>VPropertypublic$switcheroo = false
Default valuefalseDetails
Type
n/a

Methods

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

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.

Parameters
NameTypeDescription
$methodstring
$argsarray
Returns
TypeDescription
mixed
Throws
ExceptionDescription
\Zend_Oauth_Exceptionif method does not exist in config object
methodpublic__construct(array | \Zend_Config $options = null) : void

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

Parameters
NameTypeDescription
$optionsarray | \Zend_Config
methodpublicclearHttpClient() : void
staticinherited

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

Inherited from: \Zend_Oauth::clearHttpClient()
methodpublicgetAccessToken(array $queryData, \Zend_Oauth_Token_Request $token, string $httpMethod = null, \Zend_Oauth_Http_AccessToken $request = null) : \Zend_Oauth_Token_Access

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

Parameters
NameTypeDescription
$queryDataarray

GET data returned in user's redirect from Provider

$token\Zend_Oauth_Token_Request

Request Token information

$httpMethodstring
$request\Zend_Oauth_Http_AccessToken
Returns
TypeDescription
\Zend_Oauth_Token_Access
Throws
ExceptionDescription
\Zend_Oauth_Exceptionon invalid authorization token, non-matching response authorization token, or unprovided authorization token
methodpublicgetHttpClient() : \Zend_Http_Client
staticinherited

Return the singleton instance of the HTTP Client.

Inherited from: \Zend_Oauth::getHttpClient()

Note that the instance is reset and cleared of previous parameters and Authorization header values.

Returns
TypeDescription
\Zend_Http_Client
methodpublicgetLastAccessToken() : \Zend_Oauth_Token_Access

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

Returns
TypeDescription
\Zend_Oauth_Token_Access
methodpublicgetLastRequestToken() : \Zend_Oauth_Token_Request

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

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

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.

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
NameTypeDescription
$customServiceParametersnull | array
$tokennull | \Zend_Oauth_Token_Request
$redirectnull | \Zend_OAuth_Http_UserAuthorization
Returns
TypeDescription
string
methodpublicgetRequestToken(null | array $customServiceParameters = null, null | string $httpMethod = null, null | \Zend_Oauth_Http_RequestToken $request = null) : \Zend_Oauth_Token_Request

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.

Parameters
NameTypeDescription
$customServiceParametersnull | array

Non-OAuth Provider-specified parameters

$httpMethodnull | string
$requestnull | \Zend_Oauth_Http_RequestToken
Returns
TypeDescription
\Zend_Oauth_Token_Request
methodpublicgetToken() : \Zend_Oauth_Token_Access

Alias to self::getLastAccessToken()

Returns
TypeDescription
\Zend_Oauth_Token_Access
methodpublicredirect(null | array $customServiceParameters = null, null | \Zend_Oauth_Token_Request $token = null, null | \Zend_Oauth_Http_UserAuthorization $request = null) : void

Rather than retrieve a redirect URL for use, e.g.

from a controller, one may perform an immediate redirect.

Sends headers and exit()s on completion.

Parameters
NameTypeDescription
$customServiceParametersnull | array
$tokennull | \Zend_Oauth_Token_Request
$requestnull | \Zend_Oauth_Http_UserAuthorization
methodpublicsetHttpClient(\Zend_Http_Client $httpClient) : void
staticinherited

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

Inherited from: \Zend_Oauth::setHttpClient()
Parameters
NameTypeDescription
$httpClient\Zend_Http_Client
Documentation was generated by phpDocumentor 2.0.0a12.