public function login() { $token = Session::read('oauth.request'); if (empty($token)) { $this->redirect('Client::authorize'); } $this->redirect(Consumer::authenticate($token)); }
public function login() { Session::delete('oauth.request'); Session::delete('oauth.access'); $token = Consumer::token('request', array('params' => array('oauth_callback' => 'http://local.moodpik.com/tweet/success'))); Session::write('oauth.request', $token); if (empty($token)) { $this->redirect('Tweet::authorize'); } $this->redirect(Consumer::authenticate($token)); }
public function testAuthenticate() { $expected = 'http://localhost/oauth/authenticate?oauth_token=requestkey'; $result = Consumer::authenticate(array('oauth_token' => 'requestkey', 'oauth_token_secret' => 'requestsecret')); $this->assertEqual($expected, $result); }