You are here

function TwitterOAuth::getAccessToken in Tweet Feed 6

Same name and namespace in other branches
  1. 7.3 inc/twitter-oauth.inc \TwitterOAuth::getAccessToken()
  2. 7 inc/twitter-oauth.inc \TwitterOAuth::getAccessToken()
  3. 7.2 inc/twitter-oauth.inc \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

inc/twitter-oauth.inc, line 109

Class

TwitterOAuth
Twitter OAuth class

Code

function getAccessToken($oauth_verifier) {
  $parameters = array();
  $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;
}