예제 #1
0
 public function testCreateAdapterByItsClass()
 {
     $di = DI::getDefault();
     $oauth = new OAuth($di);
     $linkedin = new \Vegas\Security\OAuth\Service\Linkedin($di, $oauth->getDefaultSessionStorage());
     $this->assertInstanceOf('\\Vegas\\Security\\OAuth\\Service\\Linkedin', $linkedin);
 }
예제 #2
0
파일: Oauth.php 프로젝트: vegas-cmf/oauth
 /**
  * Setups oAuth services from configuration
  */
 protected function setupServices()
 {
     $this->oAuth = new \Vegas\Security\OAuth($this->di);
     foreach ($this->config as $serviceName => $serviceConfig) {
         $service = $this->oAuth->obtainServiceInstance($serviceName);
         $service->setupCredentials(array('key' => $serviceConfig['key'], 'secret' => $serviceConfig['secret'], 'redirect_uri' => $serviceConfig['redirect_uri']));
         if (isset($serviceConfig['scopes'])) {
             $service->setScopes($serviceConfig['scopes']);
         }
         $service->init();
         $this->oAuthServices[$serviceName] = $service;
     }
 }