23 #require_once 'Zend/Oauth.php'; 26 #require_once 'Zend/Uri.php'; 29 #require_once 'Zend/Oauth/Config/ConfigInterface.php'; 188 case 'consumerSecret':
191 case 'signatureMethod':
203 case 'requestTokenUrl':
206 case 'accessTokenUrl':
209 case 'userAuthorizationUrl':
215 case 'requestMethod':
218 case 'rsaPrivateKey':
229 if (isset(
$options[
'requestScheme'])) {
244 $this->_consumerKey = $key;
266 $this->_consumerSecret = $secret;
280 if ($this->_rsaPrivateKey !==
null) {
297 'HMAC-SHA1',
'HMAC-SHA256',
'RSA-SHA1',
'PLAINTEXT' 300 #require_once 'Zend/Oauth/Exception.php'; 303 .
'. Supported are HMAC-SHA1, RSA-SHA1, PLAINTEXT and HMAC-SHA256');
305 $this->_signatureMethod =
$method;;
328 $scheme = strtolower($scheme);
329 if (!in_array($scheme, array(
335 #require_once 'Zend/Oauth/Exception.php'; 337 '\'' . $scheme .
'\' is an unsupported request scheme
' 340 if ($scheme == Zend_Oauth::REQUEST_SCHEME_POSTBODY 341 && $this->getRequestMethod() == Zend_Oauth::GET 343 #require_once 'Zend/Oauth/Exception.php
'; 344 throw new Zend_Oauth_Exception( 345 'Cannot
set POSTBODY request method
if HTTP method
set to GET
' 348 $this->_requestScheme = $scheme; 357 public function getRequestScheme() 359 return $this->_requestScheme; 368 public function setVersion($version) 370 $this->_version = $version; 379 public function getVersion() 381 return $this->_version; 391 public function setCallbackUrl($url) 393 if (!Zend_Uri::check($url) && $url !== 'oob
') { 394 #require_once 'Zend/Oauth/Exception.php
'; 395 throw new Zend_Oauth_Exception( 396 '\
'' .
$url .
'\' is not a valid URI
' 399 $this->_callbackUrl = $url; 408 public function getCallbackUrl() 410 return $this->_callbackUrl; 420 public function setSiteUrl($url) 422 if (!Zend_Uri::check($url)) { 423 #require_once 'Zend/Oauth/Exception.php
'; 424 throw new Zend_Oauth_Exception( 425 '\
'' .
$url .
'\' is not a valid URI
' 428 $this->_siteUrl = $url; 437 public function getSiteUrl() 439 return $this->_siteUrl; 449 public function setRequestTokenUrl($url) 451 if (!Zend_Uri::check($url)) { 452 #require_once 'Zend/Oauth/Exception.php
'; 453 throw new Zend_Oauth_Exception( 454 '\
'' .
$url .
'\' is not a valid URI
' 457 $this->_requestTokenUrl = rtrim($url, '/
'); 469 public function getRequestTokenUrl() 471 if (!$this->_requestTokenUrl && $this->_siteUrl) { 472 return $this->_siteUrl . '/request_token
'; 474 return $this->_requestTokenUrl; 484 public function setAccessTokenUrl($url) 486 if (!Zend_Uri::check($url)) { 487 #require_once 'Zend/Oauth/Exception.php
'; 488 throw new Zend_Oauth_Exception( 489 '\
'' .
$url .
'\' is not a valid URI
' 492 $this->_accessTokenUrl = rtrim($url, '/
'); 504 public function getAccessTokenUrl() 506 if (!$this->_accessTokenUrl && $this->_siteUrl) { 507 return $this->_siteUrl . '/access_token
'; 509 return $this->_accessTokenUrl; 519 public function setUserAuthorizationUrl($url) 521 return $this->setAuthorizeUrl($url); 531 public function setAuthorizeUrl($url) 533 if (!Zend_Uri::check($url)) { 534 #require_once 'Zend/Oauth/Exception.php
'; 535 throw new Zend_Oauth_Exception( 536 '\
'' .
$url .
'\' is not a valid URI
' 539 $this->_authorizeUrl = rtrim($url, '/
'); 548 public function getUserAuthorizationUrl() 550 return $this->getAuthorizeUrl(); 561 public function getAuthorizeUrl() 563 if (!$this->_authorizeUrl && $this->_siteUrl) { 564 return $this->_siteUrl . '/authorize
'; 566 return $this->_authorizeUrl; 576 public function setRequestMethod($method) 578 $method = strtoupper($method); 579 if (!in_array($method, array( 587 #require_once 'Zend/Oauth/Exception.php
'; 588 throw new Zend_Oauth_Exception('Invalid method:
' . $method); 590 $this->_requestMethod = $method; 599 public function getRequestMethod() 601 return $this->_requestMethod; 610 public function setRsaPublicKey(Zend_Crypt_Rsa_Key_Public $key) 612 $this->_rsaPublicKey = $key; 621 public function getRsaPublicKey() 623 return $this->_rsaPublicKey; 632 public function setRsaPrivateKey(Zend_Crypt_Rsa_Key_Private $key) 634 $this->_rsaPrivateKey = $key; 643 public function getRsaPrivateKey() 645 return $this->_rsaPrivateKey; 654 public function setToken(Zend_Oauth_Token $token) 656 $this->_token = $token; 665 public function getToken() 667 return $this->_token; 676 public function setRealm($realm) 678 $this->_realm = $realm; 687 public function getRealm() 689 return $this->_realm; setSignatureMethod($method)
const REQUEST_SCHEME_HEADER
setRequestMethod($method)
__construct($options=null)
setUserAuthorizationUrl($url)
setConsumerSecret($secret)
setOptions(array $options)
setRequestScheme($scheme)
const REQUEST_SCHEME_QUERYSTRING
setRsaPrivateKey(Zend_Crypt_Rsa_Key_Private $key)
const REQUEST_SCHEME_POSTBODY
setRsaPublicKey(Zend_Crypt_Rsa_Key_Public $key)