You are here

function TwitterOAuth::getAccessToken in jQuery social stream 8

Same name and namespace in other branches
  1. 8.2 src/Twitter/TwitterOAuth.php \Drupal\jquery_social_stream\Twitter\TwitterOAuth::getAccessToken()

Exchange request token and secret for an access token and secret, to sign API calls.

@returns array("oauth_token" => "the-access-token", "oauth_token_secret" => "the-access-secret", "user_id" => "9436992", "screen_name" => "abraham")

File

src/Twitter/TwitterOAuth.php, line 118

Class

TwitterOAuth
Twitter OAuth class

Namespace

Drupal\jquery_social_stream\Twitter

Code

function getAccessToken($oauth_verifier = FALSE) {
  $parameters = array();
  if (!empty($oauth_verifier)) {
    $parameters['oauth_verifier'] = $oauth_verifier;
  }
  $request = $this
    ->oAuthRequest($this
    ->accessTokenURL(), 'GET', $parameters);
  $token = OAuthUtil::parse_parameters($request);
  $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
  return $token;
}