Example #1
0
 /**
  * @return string
  */
 protected function getSigningKey()
 {
     $signingKey = rawurlencode($this->credentials->getConsumerSecret()) . '&';
     if ($this->tokenSecret !== null) {
         $signingKey .= rawurlencode($this->tokenSecret);
     }
     return $signingKey;
 }
Example #2
0
 /**
  * @param string $consumerId
  * @param string $consumerSecret
  * @param string $callbackUrl
  */
 public function __construct($consumerId, $consumerSecret, $callbackUrl = '')
 {
     if (is_array($callbackUrl)) {
         if (isset($callbackUrl['privateCert'])) {
             $this->privateCert = new CredentialsCert($callbackUrl['privateCert']);
         }
         if (isset($callbackUrl['publicCert'])) {
             $this->publicCert = new CredentialsCert($callbackUrl['publicCert']);
         }
     }
     parent::__construct($consumerId, $consumerSecret, $callbackUrl);
 }
Example #3
0
 /**
  * @covers OAuth\Common\Consumer\Credentials::__construct
  * @covers OAuth\Common\Consumer\Credentials::getCallbackUrl
  */
 public function testGetCallbackUrl()
 {
     $credentials = new Credentials('foo', 'bar', 'baz');
     $this->assertSame('baz', $credentials->getCallbackUrl());
 }