Example #1
0
 /**
  * Generate a redirect URL from the allowable parameters and configured
  * values.
  *
  * @return string
  */
 public function getUrl()
 {
     $params = $this->assembleParams();
     $uri = new \Zend\URI\URL($this->_consumer->getUserAuthorizationUrl());
     $uri->setQuery($this->_httpUtility->toEncodedQueryString($params));
     return $uri->generate();
 }
Example #2
0
 /**
  * Normalize the base signature URL
  * 
  * @param  string $url 
  * @return string
  */
 public function normaliseBaseSignatureUrl($url)
 {
     $uri = new \Zend\URI\URL($url);
     if ($uri->getScheme() == 'http' && $uri->getPort() == '80') {
         $uri->setPort('');
     } elseif ($uri->getScheme() == 'https' && $uri->getPort() == '443') {
         $uri->setPort('');
     } elseif (!in_array($uri->getScheme(), array('http', 'https'))) {
         throw new OAuthException('Invalid URL provided; must be an HTTP or HTTPS scheme');
     }
     $uri->setQuery('');
     $uri->setFragment('');
     $uri->setHost(strtolower($uri->getHost()));
     return $uri->generate();
 }