Ejemplo n.º 1
0
 /**
  * Generate a signing key.
  *
  * @return string
  */
 protected function key()
 {
     $key = rawurlencode($this->clientCredentials->getSecret()) . '&';
     if ($this->credentials !== null) {
         $key .= rawurlencode($this->credentials->getSecret());
     }
     return $key;
 }
Ejemplo n.º 2
0
 /**
  * Generate the OAuth protocol header for requests other than temporary
  * credentials, based on the URI, method, given credentials & body query
  * string.
  *
  * @param  string  $method
  * @param  string  $uri
  * @param  CredentialsInterface  $credentials
  * @param  array  $bodyParameters
  * @return string
  */
 protected function protocolHeader($method, $uri, CredentialsInterface $credentials, array $bodyParameters = array())
 {
     $parameters = array_merge($this->baseProtocolParameters(), array('oauth_token' => $credentials->getIdentifier()));
     $this->signature->setCredentials($credentials);
     $parameters['oauth_signature'] = $this->signature->sign($uri, array_merge($parameters, $bodyParameters), $method);
     return $this->normalizeProtocolParameters($parameters);
 }