Authenticates against the supplied adapter

@param   AdapterInterface    $adapter
@return  \Zend\Authentication\Result
@throws  \Zend\Authentication\Exception\RuntimeException
774590
public function authenticate( AdapterInterface $adapter = null )
    {
        $result = parent::authenticate( $adapter );

        if ( $result->isValid() )
        {
            $this->identityRefreshed = true;
        }

        return $result;
    }
1236892
protected function factory(string $adapterName, array $configuration = [])
	{
		if(method_exists($this, ($method = $adapterName . 'Factory')))
		{
			return $this->$method($configuration);
		}
		elseif(isset($this->extensions[$adapterName]))
		{
			$adapter = $this->extensions[$adapterName];

			if($adapter instanceof Closure)
			{
				return $this->container->call($adapter, $configuration);
			}

			return $this->container->get($adapter, $configuration);
		}

		throw new RuntimeException(vsprintf('A factory method for the [ %s ] adapter has not been defined.', [$adapterName]));
	}
765937
public static function setAdapter($adapter)
    {
        switch (strtolower($adapter)) {
            case 'sodium':
                $adapterSet = '\Zest\Encryption\Adapter\SodiumEncryption';
                break;
            case 'openssl':
                $adapterSet = '\Zest\Encryption\Adapter\OpenSslEncryption';
                break;
            default:
                $adapterSet = '\Zest\Encryption\Adapter\OpenSslEncryption';
                break;
        }
        $key = __config()->encryption->key;
        self::$adapter = new $adapterSet($key);

        return __CLASS__;
    }
925821
public function verify()
    {
        if (is_null($this->verified)) {
            try {
                $this->verified = (bool) $this->verifyEnvironment();
                if (!$this->verified) {
                    throw new Exception\EnvironmentException("The adapter did not properly verify.");
                }
            } catch (\Exception $e) {
                $this->verificationError = $e->getMessage();
                $this->verified = false;
            }
        }

        return $this->verified;
    }
1078097
protected function _loadAclAdapter($adapter) {
		if (!class_exists($adapter)) {
			throw new Exception(sprintf('The Acl Adapter class "%s" was not found.', $adapter));
		}

		$adapterInstance = new $adapter();
		if (!($adapterInstance instanceof AclAdapterInterface)) {
			throw new InvalidArgumentException(sprintf(
				'TinyAuth Acl adapters have to implement %s.', AclAdapterInterface::class
			));
		}

		return $adapterInstance;
	}
1277359
protected function getAdapter($adapterName)
    {
        $config = $this->application->getConfig()->get(['adapters', $adapterName], Config::CONFIG_SYSTEM);
        $adapter = $this->application->getAdapterFactory()->createRepositoryManager(
            $adapterName,
            $config,
            $this->application->getConfig()
        );

        $adapter->authenticate();

        return $adapter;
    }
752278
public function setAdapter($adapter)
    {
        if (!is_string($adapter) && !$adapter instanceof ConversionAlgorithmInterface) {
            throw new Exception\InvalidArgumentException(sprintf(
                '"%s" expects a string or an instance of ConversionAlgorithmInterface; received "%s"',
                __METHOD__,
                is_object($adapter) ? get_class($adapter) : gettype($adapter)
            ));
        }
        if (is_string($adapter)) {
            if (!class_exists($adapter)) {
                throw new Exception\RuntimeException(sprintf(
                    '"%s" unable to load adapter; class "%s" not found',
                    __METHOD__,
                    $adapter
                ));
            }
            $adapter = new $adapter();
            if (!$adapter instanceof ConversionAlgorithmInterface) {
                throw new Exception\InvalidArgumentException(sprintf(
                    '"%s" expects a string representing an instance of ConversionAlgorithmInterface; received "%s"',
                    __METHOD__,
                    is_object($adapter) ? get_class($adapter) : gettype($adapter)
                ));
            }
        }
        $this->adapter = $adapter;

        return $this;
    }
93557
public static function decrypt($token, $adapter = null)
    {
        ($adapter !== null) ? self::setAdapter($adapter) : self::setAdapter(__config()->encryption->driver);

        return self::$adapter->decrypt($token);
    }
105949
public function get(array $adapters, CacheableInterface $item)
    {
        foreach ($adapters as $adapter) {

            if (false !== $value = $adapter->get($item)) {
                return $value;
            }
        }

        return false;
    }
130634
public function setAdapter($alias, AdapterInterface $adapter)
    {
        $this->adapters->set($alias, $adapter);
        return $this;
    }
50562
protected function _factory($adapter) {
		$_this = static::getInstance();

		if (!isset($adapter['engine'])) {
			$adapter['engine'] = 'Gaufrette';
		}
		if ($adapter['engine'] === static::GAUFRETTE_ENGINE) {
			return $_this->gaufretteFactory($adapter);
		}
		if ($adapter['engine'] === static::FLYSYSTEM_ENGINE) {
			return $_this->flysystemFactory($adapter);
		}

		throw new RuntimeException();
	}
635408
public function factory( $adapter, $options = null )
    {
        $adapter = parent::factory( $adapter, $options );
        $adapter->setModel( $this->getModel() );

        if ( $adapter instanceof ServiceLocatorAwareInterface )
        {
            $adapter->setServiceLocator( $this->getServiceLocator() );
        }

        return $adapter;
    }
1304034
public function setCacheAdapter(AdapterAbstract $adapter)
    {
        if ($this->isSetup) {
            $e = new ApplicationIsAlreadySetupException('You cannot set the cache after calling setup()');
            $this->error($e);
        }

        $this->cache = $adapter;
    }
1192006
public function authenticate()
    {
        if (empty($this->request)) {
            throw new Exception\RuntimeException(
                'Request and Response objects must be set before calling authenticate()'
            );
        }

        if ($this->request->getUri()->getScheme() != 'https') {

            return new Result(
                Result::FAILURE_UNCATEGORIZED,
                array(),
                array('Http authentication must be over https')
            );
        }

        return parent::authenticate();
    }
621113
public function injectAdapter(AdapterInterface $adapter, ?string $name = null): self
    {
        if (null === $name) {
            $name = get_class($adapter);
        }

        $this->logger->debug('inject auth adapter ['.$name.'] of type ['.get_class($adapter).']', [
            'category' => get_class($this),
        ]);

        if ($this->hasAdapter($name)) {
            throw new Exception\AdapterNotUnique('auth adapter '.$name.' is already registered');
        }

        $this->adapter[$name] = $adapter;

        return $this;
    }
482209
private static function loadAdapterClass($adapter)
	{
		$class = ucwords($adapter) . 'Adapter';
		$fqclass = 'ActiveRecord\\' . $class;
		$source = __DIR__ . "/Adapters/$class.php";

		if (!file_exists($source))
			throw new DatabaseException("$fqclass not found!");

		require_once($source);
		return $fqclass;
	}
149620
public function getAdapters(array $adapters = []): array
    {
        if (empty($adapter)) {
            return $this->adapter;
        }
        $list = [];
        foreach ($adapter as $name) {
            if (!$this->hasAdapter($name)) {
                throw new Exception\AdapterNotFound('auth adapter '.$name.' is not registered');
            }
            $list[$name] = $this->adapter[$name];
        }

        return $list;
    }