コード例 #1
0
 /**
  * @param ServiceLocatorInterface $serviceLocator
  * @param IdentityOptions $identityOptions
  * @return Adapter
  */
 protected function createAdapter(ServiceLocatorInterface $serviceLocator, IdentityOptions $identityOptions)
 {
     /** @var AdapterOptions $adapterOptions */
     $adapterOptions = $identityOptions->getAdapterOptions(Adapter::CLASS, AdapterOptions::CLASS);
     $adapter = new Adapter($adapterOptions->getResult(), $adapterOptions->getErrorMessage());
     return $adapter;
 }
コード例 #2
0
 /**
  * @param ServiceLocatorInterface $serviceLocator
  * @param IdentityOptions $identityOptions
  * @return Adapter
  */
 protected function createAdapter(ServiceLocatorInterface $serviceLocator, IdentityOptions $identityOptions)
 {
     /** @var AdapterOptions $adapterOptions */
     $adapterOptions = $identityOptions->getAdapterOptions(Adapter::CLASS, AdapterOptions::CLASS);
     /** @var \Detail\Auth\Identity\AdapterManager $adapters */
     $adapters = $serviceLocator->get('Detail\\Auth\\Identity\\AdapterManager');
     $chainedAdapters = $adapterOptions->getAdapters();
     if (count($chainedAdapters) === 0) {
         throw new ConfigException('Chained adapter requires at least one adapter');
     }
     $adapter = new Adapter($adapters, $chainedAdapters);
     return $adapter;
 }
コード例 #3
0
 /**
  * @param ServiceLocatorInterface $serviceLocator
  * @param IdentityOptions $identityOptions
  * @return Adapter
  */
 protected function createAdapter(ServiceLocatorInterface $serviceLocator, IdentityOptions $identityOptions)
 {
     /** @var AdapterOptions $adapterOptions */
     $adapterOptions = $identityOptions->getAdapterOptions(Adapter::CLASS, AdapterOptions::CLASS);
     $authenticationServiceClass = $adapterOptions->getService();
     if (!$authenticationServiceClass) {
         throw new ConfigException('Missing authentication service class');
     }
     /** @var \Zend\Authentication\AuthenticationService $authenticationService */
     $authenticationService = $serviceLocator->get($authenticationServiceClass);
     $adapter = new Adapter($authenticationService);
     return $adapter;
 }
 /**
  * @param ServiceLocatorInterface $serviceLocator
  * @param IdentityOptions $identityOptions
  * @return Adapter
  */
 protected function createAdapter(ServiceLocatorInterface $serviceLocator, IdentityOptions $identityOptions)
 {
     /** @var AdapterOptions $adapterOptions */
     $adapterOptions = $identityOptions->getAdapterOptions(Adapter::CLASS, AdapterOptions::CLASS);
     $authenticationAdapterClass = $adapterOptions->getAuthenticationAdapter();
     if (!$authenticationAdapterClass) {
         throw new ConfigException('Missing authentication adapter class');
     }
     /** @var \Zend\Authentication\Adapter\ValidatableAdapterInterface $authenticationAdapter */
     $authenticationAdapter = $serviceLocator->get($authenticationAdapterClass);
     $credentialHeaders = array(Adapter::CREDENTIAL_APPLICATION_ID => $adapterOptions->getAppIdHeader(), Adapter::CREDENTIAL_APPLICATION_KEY => $adapterOptions->getAppKeyHeader());
     $adapter = new Adapter($authenticationAdapter, $credentialHeaders, $this->getCache($serviceLocator, $adapterOptions->getCache()));
     return $adapter;
 }
コード例 #5
0
 /**
  * @param ServiceLocatorInterface $serviceLocator
  * @param IdentityOptions $identityOptions
  * @return Adapter
  */
 protected function createAdapter(ServiceLocatorInterface $serviceLocator, IdentityOptions $identityOptions)
 {
     /** @var AdapterOptions $adapterOptions */
     $adapterOptions = $identityOptions->getAdapterOptions(Adapter::CLASS, AdapterOptions::CLASS);
     /** @var \Detail\Auth\Options\ThreeScaleOptions $threeScaleOptions */
     $threeScaleOptions = $serviceLocator->get('Detail\\Auth\\Options\\ThreeScaleOptions');
     $clientClass = $adapterOptions->getClient();
     if (!$clientClass) {
         throw new ConfigException('Missing 3scale client class');
     }
     /** @var \ThreeScaleClient $client */
     $client = $serviceLocator->get($clientClass);
     $credentialHeaders = array(Adapter::CREDENTIAL_APPLICATION_ID => $adapterOptions->getAppIdHeader(), Adapter::CREDENTIAL_APPLICATION_KEY => $adapterOptions->getAppKeyHeader());
     $adapter = new Adapter($client, $threeScaleOptions->getServiceId(), $credentialHeaders, $this->getCache($serviceLocator, $adapterOptions->getCache()));
     return $adapter;
 }