コード例 #1
0
 public function login()
 {
     $token = Session::read('oauth.request');
     if (empty($token)) {
         $this->redirect('Client::authorize');
     }
     $this->redirect(Consumer::authenticate($token));
 }
コード例 #2
0
 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));
 }
コード例 #3
0
 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);
 }