Build a SSO server instance from settings

@param string $serverIdentifier
@return \Flowpack\SingleSignOn\Client\Domain\Model\SsoServer
195004
public function create($serverIdentifier) {
		if (!isset($this->serverConfigurations[$serverIdentifier]) || !is_array($this->serverConfigurations[$serverIdentifier])) {
			throw new Exception('Invalid configuration for server "' . $serverIdentifier . '" in Flowpack.SingleSignOn.Client.server', 1351688340);
		}
		$serverConfiguration = $this->serverConfigurations[$serverIdentifier];
		$ssoServer = new \Flowpack\SingleSignOn\Client\Domain\Model\SsoServer();
		if (!isset($serverConfiguration['serviceBaseUri']) || (string)$serverConfiguration['serviceBaseUri'] === '') {
			throw new Exception('Missing serviceBaseUri setting in Flowpack.SingleSignOn.Client.server.' . $serverIdentifier, 1352719244);
		}
		$serverConfiguration['serviceBaseUri'] = rtrim($serverConfiguration['serviceBaseUri'], '/');
		$ssoServer->setServiceBaseUri($serverConfiguration['serviceBaseUri']);
		$ssoServer->setEndpointUri($serverConfiguration['serviceBaseUri'] . '/authentication');

		if (!isset($serverConfiguration['publicKeyFingerprint']) || (string)$serverConfiguration['publicKeyFingerprint'] === '') {
			throw new Exception('Missing publicKeyFingerprint setting for Flowpack.SingleSignOn.Client.server.' . $serverIdentifier, 1351688420);
		}
		$ssoServer->setPublicKey($serverConfiguration['publicKeyFingerprint']);
		if (!isset($serverConfiguration['publicKeyFingerprint']) || (string)$serverConfiguration['publicKeyFingerprint'] === '') {
			throw new Exception('Missing publicKeyFingerprint setting for Flowpack.SingleSignOn.Client.server.' . $serverIdentifier, 1351688420);
		}

		// TODO Set service base URI
		return $ssoServer;
	}
439696
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('config');
        $config = new GuardLoaderConfig($config['guard']['instance_loader']);
        $loader = new InstanceLoader($config);

        return $loader;
    }
16214
public function get(string $entryIdentifier)
    {
        if (!$this->isValidEntryIdentifier($entryIdentifier)) {
            throw new \InvalidArgumentException('"' . $entryIdentifier . '" is not a valid cache entry identifier.', 1233058294);
        }

        $rawResult = $this->backend->get($entryIdentifier);
        if ($rawResult === false) {
            return false;
        }
        return ($this->useIgBinary === true) ? igbinary_unserialize($rawResult) : unserialize($rawResult);
    }
265662
protected function normalizeRoleIdentifier($roleIdentifier)
    {
        if (strpos($roleIdentifier, ':') === false) {
            $roleIdentifier = 'Neos.Neos:' . $roleIdentifier;
        }
        if (!$this->policyService->hasRole($roleIdentifier)) {
            throw new NoSuchRoleException(sprintf('The role %s does not exist.', $roleIdentifier), 1422540184);
        }

        return $roleIdentifier;
    }
1215953
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');

        $client = new Client();
        if (!empty($config[$this->configKey])) {

            $clientOptions = $config[$this->configKey];

            if (isset($clientOptions['uri'])) {
                $client->setUri($clientOptions['uri']);
                unset($clientOptions['uri']);
            }

            if (isset($clientOptions['auth'])) {
                $auth = $clientOptions['auth'];
                $client->setAuth(
                    isset($auth['user'])     ? $auth['user']     : '',
                    isset($auth['password']) ? $auth['password'] : '',
                    isset($auth['type'])     ? $auth['type']     : $client::AUTH_BASIC
                );
                unset($clientOptions['auth']);
            }

            $client->setOptions($config[$this->configKey]);
        }

        return $client;
    }
394872
public function setIdentifier(Identifier $identifier)
    {
        if ($this->identifier !== null) {
            //TODO: throw exception
        }

        $this->identifier = $identifier;

        return $this;
    }
387349
protected function createParsedIdentifier(SchemaIdentifierInterface $identifier): ParserIdentifierInterface
    {
        return $this->factory->createParsedIdentifier($this->position, $identifier);
    }
679691
protected function acquireToken($tokenIdentifier)
    {
        $filtered = array_filter($this->tokens, function ($val) use ($tokenIdentifier) {
            return $val['token'] === $tokenIdentifier;
        });
        $keys = array_keys($filtered);
        $this->tokens[$keys[0]]['available'] = false;
    }
48966
public function addIdentifier($identifier)
    {
        if (!isset($this->identifiers[$identifier])) {
            $this->identifiers[$identifier] = $identifier;
        }

        return $this;
    }
555468
public function get(string $entryIdentifier)
    {
        return $this->uncompress($this->redis->get($this->buildKey('entry:' . $entryIdentifier)));
    }
761889
public function makeAuthorizationServer()
    {
        return new AuthorizationServer(
            $this->app->make(Bridge\ClientRepository::class),
            $this->app->make(Bridge\AccessTokenRepository::class),
            $this->app->make(Bridge\ScopeRepository::class),
            $this->makeCryptKey('private'),
            app('encrypter')->getKey()
        );
    }
363224
private function createSoapHeaderObject(
        AdsServiceDescriptor $serviceDescriptor
    ) {
        // The SOAP header object is in the same namespace as the Ad Manager
        // service we are generating headers for.
        $reflectionClass = new ReflectionClass(
            $serviceDescriptor->getServiceClass()
        );

        return $this->reflection->createInstance(
            sprintf(
                '%s\\%s',
                $reflectionClass->getNamespaceName(),
                self::SOAP_HEADER_CLASS_NAME
            )
        );
    }
695792
public function getUserEntityByIdentifier(string $userIdentifier): UserEntity
    {
        return new UserEntity(Member::get()->filter(['Email' => $userIdentifier])->first());
    }
833108
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $parser = $serviceLocator->get('ControllerNameParser');
        $logger = $serviceLocator->has('Logger') ? $serviceLocator->get('Logger') : null;

        return new ControllerResolver($serviceLocator, $parser, $logger);
    }
795207
public function buildForm($identifier = null)
	{
		$this->setFormMapper(new FormMapper);
		$this->configureForm($this->getFormMapper());

		$this->setFormBuilder(new FormBuilder($this->getFormMapper()));
		$this->getFormBuilder()
			->setModel($this->getModel())
			->setIdentifier($identifier)
			->setContext($identifier === null ? FormBuilder::CONTEXT_CREATE : FormBuilder::CONTEXT_EDIT)
			->build();

		return $this;
	}
137837
public static function create(string $recognizer): self
    {
        $recognizerDeviation = new self();

        $recognizerDeviation->type       = self::TYPE;
        $recognizerDeviation->recognizer = $recognizer;

        return $recognizerDeviation;
    }
329783
private function bootIoServer()
    {
        $context = [
            'tls' => $this->tls,
        ];
        $socket = new SocketServer($this->host.':'.$this->port, $this->getEventLoop(), $context);

        return new IoServer(
            $this->serverInstance,
            $socket,
            $this->getEventLoop()
        );
    }