public function getToken($oauthToken, $oauthVerifier, TemporaryCredentials $temporaryCredentials = null)
    {
        if (is_null($temporaryCredentials)) {
            $sessionKey = self::getCredentialSessionKey();
            $temporaryCredentials = unserialize($_SESSION[$sessionKey]);
            unset($_SESSION[$sessionKey]);
            session_write_close();
        }

        return $this->client->getTokenCredentials(
            $temporaryCredentials,
            $oauthToken,
            $oauthVerifier
        );
    }
public function getToken($oauthToken, $oauthVerifier, TemporaryCredentials $temporaryCredentials = null)
    {
        if (is_null($temporaryCredentials)) {
            $sessionKey = self::getCredentialSessionKey();
            $temporaryCredentials = unserialize($_SESSION[$sessionKey]);
            unset($_SESSION[$sessionKey]);
            session_write_close();
        }

        return $this->client->getTokenCredentials(
            $temporaryCredentials,
            $oauthToken,
            $oauthVerifier
        );
    }
public function getToken ( $ oauthToken , $ oauthVerifier , TemporaryCredentials $ temporaryCredentials = null ) { if ( is_null ( $ temporaryCredentials ) ) { $ sessionKey = self :: getCredentialSessionKey ( ) ; $ temporaryCredentials = unserialize ( $ _SESSION [ $ sessionKey ] ) ; unset ( $ _SESSION [ $ sessionKey ] ) ; session_write_close ( ) ; } return $ this -> client -> getTokenCredentials ( $ temporaryCredentials , $ oauthToken , $ oauthVerifier ) ; }
Verify and fetch token

Retrieve the temporary credentials from step 2. Third and final part to
OAuth 1.0 authentication is to retrieve token credentials (formally
known as access tokens in earlier OAuth 1.0 specs). Now, we'll store
the token credentials and discard the temporary ones - they're
irrelevant at this stage.

@param  string               $oauthToken
@param  string               $oauthVerifier
@param  TemporaryCredentials $temporaryCredentials

@return \League\OAuth1\Client\Credentials\CredentialsInterface
Verify and fetch token