public function testSignatureWithAccessSecretIsHashedWithConsumerAndAccessSecret() { $params = array('oauth_version' => '1.0', 'oauth_consumer_key' => 'dpf43f3p2l4k3l03', 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_timestamp' => '1191242090', 'oauth_nonce' => 'hsu94j3884jdopsl', 'oauth_version' => '1.0'); $signature = new Zend_Oauth_Signature_Hmac('1234567890', '0987654321', 'SHA1'); $this->assertEquals('b0J6H0jCEo+tvzVJy2G615sM6/M=', $signature->sign($params)); }
/** * Gets an HMAC-SHA1 signature for the request * * @param string $httpMethod * @return string */ protected function _generateOauthSignature($httpMethod = 'POST') { $sig = new Zend_Oauth_Signature_Hmac($this->_getOauthConsumerSecret(), null, 'sha1'); $signatureString = $sig->sign($this->_oauthParams, $httpMethod, $this->getUrl()); $this->_oauthParams['oauth_signature'] = $signatureString; return $signatureString; }