コード例 #1
0
ファイル: XingServerTest.php プロジェクト: Kazhw/grp10
 /**
  * @expectedException InvalidArgumentException
  */
 public function testGettingTokenCredentialsFailsWithManInTheMiddle()
 {
     $server = new Xing($this->getMockClientCredentials());
     $credentials = m::mock('League\\OAuth1\\Client\\Credentials\\TemporaryCredentials');
     $credentials->shouldReceive('getIdentifier')->andReturn('foo');
     $server->getTokenCredentials($credentials, 'bar', 'verifier');
 }
コード例 #2
0
ファイル: Xingapi.php プロジェクト: gelembjuk/auth
 /**
  * Completes social login. Is caled after redirect from Xing auth page
  * 
  * @param array $extrainputs List of POST/GET arguments names
  */
 public function completeLogin($extrainputs = array())
 {
     if (!isset($extrainputs['oauth_token']) || $extrainputs['oauth_token'] == '') {
         throw new \Exception('Xing oauth. Somethign went wrong. No token in the session');
     }
     $credentials = array('identifier' => $this->options['consumer_key'], 'secret' => $this->options['consumer_secret']);
     $server = new \League\OAuth1\Client\Server\Xing($credentials);
     $this->access_token = $server->getTokenCredentials($this->temp_credentials, $extrainputs['oauth_token'], $extrainputs['oauth_verifier']);
     return $this->getUserProfile();
 }