src/Twitter/Connections/UserConnection.php
public function getAccessToken($oauthToken, $oauthVerifier)
    {
        //Oauth1 plugin to get access tokens!
        $oauth = new Oauth1(array(
            'consumer_key'    => $this->credentials->getConsumerKey(),
            'consumer_secret' => $this->credentials->getConsumerSecret(),
            'token'           => $oauthToken,
            'verifier'        => $oauthVerifier
        ));

        //attach oauth to request
        $this->guzzleClient->getEmitter()->attach($oauth);

        //POST to 'oauth/access_token' - get access tokens
        $accessTokenResponse = $this->guzzleClient->post(
            Config::get('oauth_access_token'),
            array(
                'auth' => 'oauth'
            )
        );

        //handle response
        $response = array();
        parse_str($accessTokenResponse->getBody(), $response);

        //set access tokens
        $this->credentials
            ->setAccessToken($response['oauth_token'])
            ->setAccessTokenSecret($response['oauth_token_secret']);

        return $response; //contains 'oauth_token', 'oauth_token_secret', 'user_id' and 'screen_name'
    }
public function getAccessToken($oauthToken, $oauthVerifier)
    {
        //Oauth1 plugin to get access tokens!
        $oauth = new Oauth1(array(
            'consumer_key'    => $this->credentials->getConsumerKey(),
            'consumer_secret' => $this->credentials->getConsumerSecret(),
            'token'           => $oauthToken,
            'verifier'        => $oauthVerifier
        ));

        //attach oauth to request
        $this->guzzleClient->getEmitter()->attach($oauth);

        //POST to 'oauth/access_token' - get access tokens
        $accessTokenResponse = $this->guzzleClient->post(
            Config::get('oauth_access_token'),
            array(
                'auth' => 'oauth'
            )
        );

        //handle response
        $response = array();
        parse_str($accessTokenResponse->getBody(), $response);

        //set access tokens
        $this->credentials
            ->setAccessToken($response['oauth_token'])
            ->setAccessTokenSecret($response['oauth_token_secret']);

        return $response; //contains 'oauth_token', 'oauth_token_secret', 'user_id' and 'screen_name'
    }
public function getAccessToken ( $ oauthToken , $ oauthVerifier ) { //Oauth1 plugin to get access tokens! $ oauth = new Oauth1 ( array ( 'consumer_key' => $ this -> credentials -> getConsumerKey ( ) , 'consumer_secret' => $ this -> credentials -> getConsumerSecret ( ) , 'token' => $ oauthToken , 'verifier' => $ oauthVerifier ) ) ; //attach oauth to request $ this -> guzzleClient -> getEmitter ( ) -> attach ( $ oauth ) ; //POST to 'oauth/access_token' - get access tokens $ accessTokenResponse = $ this -> guzzleClient -> post ( Config :: get ( 'oauth_access_token' ) , array ( 'auth' => 'oauth' ) ) ; //handle response $ response = array ( ) ; parse_str ( $ accessTokenResponse -> getBody ( ) , $ response ) ; //set access tokens $ this -> credentials -> setAccessToken ( $ response [ 'oauth_token' ] ) -> setAccessTokenSecret ( $ response [ 'oauth_token_secret' ] ) ; return $ response ; //contains 'oauth_token', 'oauth_token_secret', 'user_id' and 'screen_name' }
Get Access tokens from the user in exchange of oauth_token and oauth_verifier and return
them.

@param  string $oauthToken
@param  string $oauthVerifier
@return array contains 'oauth_token', 'oauth_token_secret', 'user_id' and 'screen_name'.
Get Access tokens from the user in exchange of oauth_token and oauth_verifier and return them .