\Zend_Oauth_Consumer
- Copyright: Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Oauth_Consumer
extends Zend_Oauth
{
- // Inherited constants 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';
- // members
- public boolean $switcheroo = false;
- protected Zend_Oauth_Token_Request $_requestToken = NULL;
- protected Zend_Oauth_Token_Access $_accessToken = NULL;
- protected Zend_Oauth_Config $_config = NULL;
- // Inherited members from Zend_Oauth
- protected static Zend_Http_Client $httpClient;
- // methods
- public void __construct()
- public Zend_Oauth_Token_Request getRequestToken()
- public string getRedirectUrl()
- public void redirect()
- public Zend_Oauth_Token_Access getAccessToken()
- public Zend_Oauth_Token_Request getLastRequestToken()
- public Zend_Oauth_Token_Access getLastAccessToken()
- public Zend_Oauth_Token_Access getToken()
- public mixed __call()
- // Inherited methods from Zend_Oauth
- public static void setHttpClient()
- public static Zend_Http_Client getHttpClient()
- public static void clearHttpClient()
Hierarchy
Extends
Constants
Name | Value |
---|---|
REQUEST_SCHEME_HEADER | 'header' |
REQUEST_SCHEME_POSTBODY | 'postbody' |
REQUEST_SCHEME_QUERYSTRING | 'querystring' |
GET | 'GET' |
POST | 'POST' |
PUT | 'PUT' |
DELETE | 'DELETE' |
HEAD | 'HEAD' |
Members
protected
- $_accessToken
—
Zend_Oauth_Token_Access
Access token retrieved from OAuth Provider - $_config — Zend_Oauth_Config
- $_requestToken
—
Zend_Oauth_Token_Request
Request Token retrieved from OAuth Provider - $httpClient
—
Zend_Http_Client
Singleton instance if required of the HTTP client
public
- $switcheroo
Methods
public
- __construct() — Constructor; create a new object with an optional array|Zend_Config instance containing initialising options.
- __call() — 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.
- getAccessToken() — Retrieve an Access Token in exchange for a previously received/authorized Request Token.
- getLastAccessToken() — Return whatever the last Access Token retrieved was while using the current Consumer instance.
- getLastRequestToken() — Return whatever the last Request Token retrieved was while using the current Consumer instance.
- getRedirectUrl() — 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.
- getRequestToken() — 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.
- getToken() — Alias to self::getLastAccessToken()
- redirect() — Rather than retrieve a redirect URL for use, e.g. from a controller, one may perform an immediate redirect.
Inherited from Zend_Oauth
public
- clearHttpClient() — Simple mechanism to delete the entire singleton HTTP Client instance which forces an new instantiation for subsequent requests.
- getHttpClient() — Return the singleton instance of the HTTP Client. Note that the instance is reset and cleared of previous parameters and Authorization header values.
- setHttpClient() — Allows the external environment to make Zend_Oauth use a specific Client instance.