/** * Generates and outputs a request token * @throws ProviderException */ public function outputRequestToken() { $token = OAuthProviderWrapper::generateToken(); $tokenSecret = OAuthProviderWrapper::generateToken(); $RequestToken = new OAuthRequestTokenModel(Configuration::getDataStore()); $RequestToken->setToken($token); $RequestToken->setTokenSecret($tokenSecret); $RequestToken->setTokenDate(time()); $RequestToken->setTokenConsumerKey($this->Provider->consumer_key); $RequestToken->setTokenCallback($_GET['oauth_callback']); $RequestToken->setTokenScope($_GET['scope']); try { $RequestToken->save(); } catch (DataStoreCreateException $Exception) { throw new ProviderException($Exception->getMessage()); } echo "oauth_token={$token}&oauth_token_secret={$tokenSecret}&oauth_callback_confirmed=true"; }