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
        );
    }