Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Zend_Oauth_Consumer Class Reference

Public Member Functions

 __construct ($options=null)
 Constructor; create a new object with an optional array|Zend_Config instance containing initialising options.
 
 getRequestToken (array $customServiceParameters=null, $httpMethod=null, Zend_Oauth_Http_RequestToken $request=null)
 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.
 
 getRedirectUrl (array $customServiceParameters=null, Zend_Oauth_Token_Request $token=null, Zend_Oauth_Http_UserAuthorization $redirect=null)
 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.
 
 redirect (array $customServiceParameters=null, Zend_Oauth_Token_Request $token=null, Zend_Oauth_Http_UserAuthorization $request=null)
 Rather than retrieve a redirect URL for use, e.g.
 
 getAccessToken ($queryData, Zend_Oauth_Token_Request $token, $httpMethod=null, Zend_Oauth_Http_AccessToken $request=null)
 Retrieve an Access Token in exchange for a previously received/authorized Request Token.
 
 getLastRequestToken ()
 Return whatever the last Request Token retrieved was while using the current Consumer instance.
 
 getLastAccessToken ()
 Return whatever the last Access Token retrieved was while using the current Consumer instance.
 
 getToken ()
 Alias to self::getLastAccessToken()
 
 __call ($method, array $args)
 Simple Proxy to the current Zend_Oauth_Config method.
 

Public Attributes

 $switcheroo = false
 
- Public Attributes inherited from Zend_Oauth
const REQUEST_SCHEME_HEADER = 'header'
 
const REQUEST_SCHEME_POSTBODY = 'postbody'
 
const REQUEST_SCHEME_QUERYSTRING = 'querystring'
 
const GET = 'GET'
 
const POST = 'POST'
 
const PUT = 'PUT'
 
const DELETE = 'DELETE'
 
const HEAD = 'HEAD'
 
const OPTIONS = 'OPTIONS'
 

Protected Attributes

 $_requestToken = null
 
 $_accessToken = null
 
 $_config = null
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Oauth
static setHttpClient (Zend_Http_Client $httpClient)
 Allows the external environment to make Zend_Oauth use a specific Client instance.
 
static getHttpClient ()
 Return the singleton instance of the HTTP Client.
 
static clearHttpClient ()
 Simple mechanism to delete the entire singleton HTTP Client instance which forces an new instantiation for subsequent requests.
 
- Static Protected Attributes inherited from Zend_Oauth
static $httpClient = null
 

Constructor & Destructor Documentation

__construct (   $options = null)

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

Parameters
array | Zend_Config$options
Returns
void

Member Function Documentation

__call (   $method,
array  $args 
)

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
string$method
array$args
Returns
mixed
Exceptions
Zend_Oauth_Exceptionif method does not exist in config object
getAccessToken (   $queryData,
Zend_Oauth_Token_Request  $token,
  $httpMethod = null,
Zend_Oauth_Http_AccessToken  $request = null 
)

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

Parameters
array$queryDataGET data returned in user's redirect from Provider
Zend_Oauth_Token_RequestRequest Token information
string$httpMethod
Zend_Oauth_Http_AccessToken$request
Returns
Zend_Oauth_Token_Access
Exceptions
Zend_Oauth_Exceptionon invalid authorization token, non-matching response authorization token, or unprovided authorization token
getLastAccessToken ( )

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

Returns
Zend_Oauth_Token_Access
getLastRequestToken ( )

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

Returns
Zend_Oauth_Token_Request
getRedirectUrl ( array  $customServiceParameters = null,
Zend_Oauth_Token_Request  $token = null,
Zend_Oauth_Http_UserAuthorization  $redirect = null 
)

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
null | array$customServiceParameters
null | Zend_Oauth_Token_Request$token
null | Zend_OAuth_Http_UserAuthorization$redirect
Returns
string
getRequestToken ( array  $customServiceParameters = null,
  $httpMethod = null,
Zend_Oauth_Http_RequestToken  $request = null 
)

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
null | array$customServiceParametersNon-OAuth Provider-specified parameters
null | string$httpMethod
null | Zend_Oauth_Http_RequestToken$request
Returns
Zend_Oauth_Token_Request
getToken ( )

Alias to self::getLastAccessToken()

Returns
Zend_Oauth_Token_Access
redirect ( array  $customServiceParameters = null,
Zend_Oauth_Token_Request  $token = null,
Zend_Oauth_Http_UserAuthorization  $request = null 
)

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
null | array$customServiceParameters
null | Zend_Oauth_Token_Request$token
null | Zend_Oauth_Http_UserAuthorization$request
Returns
void

Member Data Documentation

$_accessToken = null
protected
$_config = null
protected
$_requestToken = null
protected
$switcheroo = false