Oauth/Config.php
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-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Oauth
- Version
- $Id$
\Zend_Oauth_Config
Package: Zend_Oauth



































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

string $_accessTokenUrl = nullThe URL to which requests for an Access Token should be directed.
When absent, assumed siteUrl+'/access_token'
Default valuenullDetails- Type
- string

string $_authorizeUrl = nullThe URL to which users should be redirected to authorize a Request Token.
When absent, assumed siteUrl+'/authorize'
Default valuenullDetails- Type
- string

string $_callbackUrl = nullThis 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

string $_consumerSecret = nullEvery Consumer Key has a Consumer Secret unless you're in RSA-land.
Default value
nullDetails- Type
- string

string $_requestMethod = \Zend_Oauth::POSTPreferred 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 value
\Zend_Oauth::POSTDetails- Type
- string

string $_requestScheme = \Zend_Oauth::REQUEST_SCHEME_HEADERThree 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 value
\Zend_Oauth::REQUEST_SCHEME_HEADERDetails- Type
- string

string $_requestTokenUrl = nullThe URL to which requests for a Request Token should be directed.
When absent, assumed siteUrl+'/request_token'
Default valuenullDetails- Type
- string

\Zend_Crypt_Rsa_Key_Private $_rsaPrivateKey = nullIf relevant, a PEM encoded RSA private key encapsulated as a
Zend_Crypt_Rsa Key
Default value
nullDetails
\Zend_Crypt_Rsa_Key_Public $_rsaPublicKey = nullIf relevant, a PEM encoded RSA public key encapsulated as a
Zend_Crypt_Rsa Key
Default value
nullDetails
string $_signatureMethod = 'HMAC-SHA1'Signature method used when signing all parameters for an HTTP request
Default value
'HMAC-SHA1'Details- Type
- string

string $_siteUrl = nullThe URL root to append default OAuth endpoint paths.
Default value
nullDetails- Type
- string

\Zend_Oauth_Token $_token = nullGenerally this will nearly always be an Access Token represented as a
Zend_Oauth_Token_Access object.
Default value
nullDetailsMethods

__construct(array | \Zend_Config $options = null) : voidConstructor; create a new object with an optional array|Zend_Config instance containing initialising options.
Parameters
| Name | Type | Description |
|---|---|---|
| $options | array | \Zend_Config |

getAccessTokenUrl() : stringGet 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 |

getAuthorizeUrl() : stringGet 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 |

getConsumerSecret() : stringGet consumer secret
Returns RSA private key if set; otherwise, returns any previously set
consumer secret.
Returns| Type | Description |
|---|---|
| string |

getRequestTokenUrl() : stringGet 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 |

getRsaPrivateKey() : \Zend_Crypt_Rsa_Key_PrivateGet RSA private key
Returns
| Type | Description |
|---|---|
| \Zend_Crypt_Rsa_Key_Private |

getRsaPublicKey() : \Zend_Crypt_Rsa_Key_PublicGet RSA public key
Returns
| Type | Description |
|---|---|
| \Zend_Crypt_Rsa_Key_Public |

setAccessTokenUrl(string $url) : \Zend_Oauth_ConfigSet access token URL
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $url | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |
| Exception | Description |
|---|---|
| \Zend_Oauth_Exception | for invalid URLs |

setAuthorizeUrl(string $url) : \Zend_Oauth_ConfigSet authorization URL
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $url | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |
| Exception | Description |
|---|---|
| \Zend_Oauth_Exception | for invalid URLs |

setCallbackUrl(string $url) : \Zend_Oauth_ConfigSet callback URL
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $url | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |
| Exception | Description |
|---|---|
| \Zend_Oauth_Exception | for invalid URLs |

setConsumerKey(string $key) : \Zend_Oauth_ConfigSet consumer key
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $key | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |

setConsumerSecret(string $secret) : \Zend_Oauth_ConfigSet consumer secret
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $secret | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |

setOptions(array | \Zend_Config $options) : \Zend_Oauth_ConfigParse option array or Zend_Config instance and setup options using their relevant mutators.
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $options | array | \Zend_Config |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |

setRealm(string $realm) : \Zend_Oauth_ConfigSet OAuth realm
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $realm | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |

setRequestMethod(string $method) : \Zend_Oauth_ConfigSet request method
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $method | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |
| Exception | Description |
|---|---|
| \Zend_Oauth_Exception | for invalid request methods |

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

setRequestTokenUrl(string $url) : \Zend_Oauth_ConfigSet request token URL
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $url | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |
| Exception | Description |
|---|---|
| \Zend_Oauth_Exception | for invalid URLs |

setRsaPrivateKey(\Zend_Crypt_Rsa_Key_Private $key) : \Zend_Oauth_ConfigSet RSA private key
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $key | \Zend_Crypt_Rsa_Key_Private |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |

setRsaPublicKey(\Zend_Crypt_Rsa_Key_Public $key) : \Zend_Oauth_ConfigSet RSA public key
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $key | \Zend_Crypt_Rsa_Key_Public |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |

setSignatureMethod(string $method) : \Zend_Oauth_ConfigSet signature method
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $method | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |
| Exception | Description |
|---|---|
| \Zend_Oauth_Exception | if unsupported signature method specified |

setSiteUrl(string $url) : \Zend_Oauth_ConfigSet site URL
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $url | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |
| Exception | Description |
|---|---|
| \Zend_Oauth_Exception | for invalid URLs |

setToken(\Zend_Oauth_Token $token) : \Zend_Oauth_ConfigSet OAuth token
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $token | \Zend_Oauth_Token |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |

setUserAuthorizationUrl(string $url) : \Zend_Oauth_ConfigSet user authorization URL
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $url | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |
| Exception | Description |
|---|---|
| \Zend_Oauth_Exception | for invalid URLs |

setVersion(string $version) : \Zend_Oauth_ConfigSet version
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $version | string |
| Type | Description |
|---|---|
| \Zend_Oauth_Config |