API Documentation

Zend/Oauth/Config.php

Show: inherited
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: Config.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Oauth_Config

Package: Zend\Oauth

Implements
\Zend_Oauth_Config_ConfigInterface
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotectedstring  $_accessTokenUrl= 'null'

The URL to which requests for an Access Token should be directed.

When absent, assumed siteUrl+'/access_token'

Default valuenullDetails
Type
string
Propertyprotectedstring  $_authorizeUrl= 'null'

The URL to which users should be redirected to authorize a Request Token.

When absent, assumed siteUrl+'/authorize'

Default valuenullDetails
Type
string
Propertyprotectedstring  $_callbackUrl= 'null'

This optional value is used to define where the user is redirected to after authorizing a Request Token from an OAuth Providers website.

It's optional since a Provider may ask for this to be defined in advance when registering a new application for a Consumer Key.

Default valuenullDetails
Type
string
Propertyprotectedstring  $_consumerKey= 'null'

An OAuth application's Consumer Key.

Default valuenullDetails
Type
string
Propertyprotectedstring  $_consumerSecret= 'null'

Every Consumer Key has a Consumer Secret unless you're in RSA-land.

Default valuenullDetails
Type
string
Propertyprotectedstring  $_realm= 'null'

Define the OAuth realm

Default valuenullDetails
Type
string
Propertyprotectedstring  $_requestMethod= 'Zend_Oauth::POST'

Preferred request Method - one of GET or POST - which Zend_Oauth will enforce as standard throughout the library. Generally a default of POST works fine unless a Provider specifically requires otherwise.

Default valueZend_Oauth::POSTDetails
Type
string
Propertyprotectedstring  $_requestScheme= 'Zend_Oauth::REQUEST_SCHEME_HEADER'

Three request schemes are defined by OAuth, of which passing all OAuth parameters by Header is preferred. The other two are POST Body and Query String.

Default valueZend_Oauth::REQUEST_SCHEME_HEADERDetails
Type
string
Propertyprotectedstring  $_requestTokenUrl= 'null'

The URL to which requests for a Request Token should be directed.

When absent, assumed siteUrl+'/request_token'

Default valuenullDetails
Type
string
Propertyprotected\Zend_Crypt_Rsa_Key_Private  $_rsaPrivateKey= 'null'

If relevant, a PEM encoded RSA private key encapsulated as a Zend_Crypt_Rsa Key

Default valuenullDetails
Type
\Zend_Crypt_Rsa_Key_Private
Propertyprotected\Zend_Crypt_Rsa_Key_Public  $_rsaPublicKey= 'null'

If relevant, a PEM encoded RSA public key encapsulated as a Zend_Crypt_Rsa Key

Default valuenullDetails
Type
\Zend_Crypt_Rsa_Key_Public
Propertyprotectedstring  $_signatureMethod= ''HMAC-SHA1''

Signature method used when signing all parameters for an HTTP request

Default value'HMAC-SHA1'Details
Type
string
Propertyprotectedstring  $_siteUrl= 'null'

The URL root to append default OAuth endpoint paths.

Default valuenullDetails
Type
string
Propertyprotected\Zend_Oauth_Token  $_token= 'null'

Generally this will nearly always be an Access Token represented as a Zend_Oauth_Token_Access object.

Default valuenullDetails
Type
\Zend_Oauth_Token
Propertyprotectedstring  $_version= ''1.0''

OAuth Version; This defaults to 1.0 - Must not be changed!

Default value'1.0'Details
Type
string

Methods

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

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

Parameters
Name Type Description
$options array|\Zend_Config
methodpublicgetAccessTokenUrl( ) : string

Get access token URL

If no access token URL has been set, but a site URL has, returns the site URL with the string "/access_token" appended.

Returns
Type Description
string
methodpublicgetAuthorizeUrl( ) : string

Get authorization URL

If no authorization URL has been set, but a site URL has, returns the site URL with the string "/authorize" appended.

Returns
Type Description
string
methodpublicgetCallbackUrl( ) : string

Get callback URL

Returns
Type Description
string
methodpublicgetConsumerKey( ) : string

Get consumer key

Returns
Type Description
string
methodpublicgetConsumerSecret( ) : string

Get consumer secret

Returns RSA private key if set; otherwise, returns any previously set consumer secret.

Returns
Type Description
string
methodpublicgetRealm( ) : string

Get OAuth realm

Returns
Type Description
string
methodpublicgetRequestMethod( ) : string

Get request method

Returns
Type Description
string
methodpublicgetRequestScheme( ) : string

Get request scheme

Returns
Type Description
string
methodpublicgetRequestTokenUrl( ) : string

Get request token URL

If no request token URL has been set, but a site URL has, returns the site URL with the string "/request_token" appended.

Returns
Type Description
string
methodpublicgetRsaPrivateKey( ) : \Zend_Crypt_Rsa_Key_Private

Get RSA private key

Returns
Type Description
\Zend_Crypt_Rsa_Key_Private
methodpublicgetRsaPublicKey( ) : \Zend_Crypt_Rsa_Key_Public

Get RSA public key

Returns
Type Description
\Zend_Crypt_Rsa_Key_Public
methodpublicgetSignatureMethod( ) : string

Get signature method

Returns
Type Description
string
methodpublicgetSiteUrl( ) : string

Get site URL

Returns
Type Description
string
methodpublicgetToken( ) : \Zend_Oauth_Token

Get OAuth token

Returns
Type Description
\Zend_Oauth_Token
methodpublicgetUserAuthorizationUrl( ) : string

Get user authorization URL

Returns
Type Description
string
methodpublicgetVersion( ) : string

Get version

Returns
Type Description
string
methodpublicsetAccessTokenUrl( string $url ) : \Zend_Oauth_Config

Set access token URL

Parameters
Name Type Description
$url string
Returns
Type Description
\Zend_Oauth_Config
Throws
Exception Description
\Zend_Oauth_Exception for invalid URLs
methodpublicsetAuthorizeUrl( string $url ) : \Zend_Oauth_Config

Set authorization URL

Parameters
Name Type Description
$url string
Returns
Type Description
\Zend_Oauth_Config
Throws
Exception Description
\Zend_Oauth_Exception for invalid URLs
methodpublicsetCallbackUrl( string $url ) : \Zend_Oauth_Config

Set callback URL

Parameters
Name Type Description
$url string
Returns
Type Description
\Zend_Oauth_Config
Throws
Exception Description
\Zend_Oauth_Exception for invalid URLs
methodpublicsetConsumerKey( string $key ) : \Zend_Oauth_Config

Set consumer key

Parameters
Name Type Description
$key string
Returns
Type Description
\Zend_Oauth_Config
methodpublicsetConsumerSecret( string $secret ) : \Zend_Oauth_Config

Set consumer secret

Parameters
Name Type Description
$secret string
Returns
Type Description
\Zend_Oauth_Config
methodpublicsetOptions( array|\Zend_Config $options ) : \Zend_Oauth_Config

Parse option array or Zend_Config instance and setup options using their relevant mutators.

Parameters
Name Type Description
$options array|\Zend_Config
Returns
Type Description
\Zend_Oauth_Config
methodpublicsetRealm( string $realm ) : \Zend_Oauth_Config

Set OAuth realm

Parameters
Name Type Description
$realm string
Returns
Type Description
\Zend_Oauth_Config
methodpublicsetRequestMethod( string $method ) : \Zend_Oauth_Config

Set request method

Parameters
Name Type Description
$method string
Returns
Type Description
\Zend_Oauth_Config
Throws
Exception Description
\Zend_Oauth_Exception for invalid request methods
methodpublicsetRequestScheme( string $scheme ) : \Zend_Oauth_Config

Set request scheme

Parameters
Name Type Description
$scheme string
Returns
Type Description
\Zend_Oauth_Config
Throws
Exception Description
\Zend_Oauth_Exception if invalid scheme specified, or if POSTBODY set when request method of GET is specified
methodpublicsetRequestTokenUrl( string $url ) : \Zend_Oauth_Config

Set request token URL

Parameters
Name Type Description
$url string
Returns
Type Description
\Zend_Oauth_Config
Throws
Exception Description
\Zend_Oauth_Exception for invalid URLs
methodpublicsetRsaPrivateKey( \Zend_Crypt_Rsa_Key_Private $key ) : \Zend_Oauth_Config

Set RSA private key

Parameters
Name Type Description
$key \Zend_Crypt_Rsa_Key_Private
Returns
Type Description
\Zend_Oauth_Config
methodpublicsetRsaPublicKey( \Zend_Crypt_Rsa_Key_Public $key ) : \Zend_Oauth_Config

Set RSA public key

Parameters
Name Type Description
$key \Zend_Crypt_Rsa_Key_Public
Returns
Type Description
\Zend_Oauth_Config
methodpublicsetSignatureMethod( string $method ) : \Zend_Oauth_Config

Set signature method

Parameters
Name Type Description
$method string
Returns
Type Description
\Zend_Oauth_Config
Throws
Exception Description
\Zend_Oauth_Exception if unsupported signature method specified
methodpublicsetSiteUrl( string $url ) : \Zend_Oauth_Config

Set site URL

Parameters
Name Type Description
$url string
Returns
Type Description
\Zend_Oauth_Config
Throws
Exception Description
\Zend_Oauth_Exception for invalid URLs
methodpublicsetToken( \Zend_Oauth_Token $token ) : \Zend_Oauth_Config

Set OAuth token

Parameters
Name Type Description
$token \Zend_Oauth_Token
Returns
Type Description
\Zend_Oauth_Config
methodpublicsetUserAuthorizationUrl( string $url ) : \Zend_Oauth_Config

Set user authorization URL

Parameters
Name Type Description
$url string
Returns
Type Description
\Zend_Oauth_Config
Throws
Exception Description
\Zend_Oauth_Exception for invalid URLs
methodpublicsetVersion( string $version ) : \Zend_Oauth_Config

Set version

Parameters
Name Type Description
$version string
Returns
Type Description
\Zend_Oauth_Config
Documentation was generated by DocBlox 0.15.1.