Beispiel #1
0
 /**
  * Access token header.
  *
  * @param \OAuth1\Contracts\Token\RequestTokenInterface $requestToken
  * @param string                                        $verifier
  *
  * @return array
  */
 public function accessTokenHeaders(RequestTokenInterface $requestToken, $verifier)
 {
     $parameters = $this->baseProtocolParameters();
     $parameters['oauth_token'] = $requestToken->key();
     $parameters['oauth_verifier'] = $verifier;
     $parameters['oauth_signature'] = $this->signer()->setTokenSecret($requestToken->secret())->sign($this->accessTokenUrl(), $parameters);
     return ['Authorization' => $this->authorizationHeaders($parameters)];
 }
Beispiel #2
0
 /**
  * Build authorization url.
  *
  * @param \OAuth1\Contracts\Tokens\RequestTokenInterface $requestToken
  *
  * @return string
  */
 public function buildAuthorizationUrl(RequestTokenInterface $requestToken)
 {
     $query = http_build_query(['oauth_token' => $requestToken->key()]);
     return $this->authorizeUrl() . '?' . $query;
 }