/** * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container */ public function prepend(ContainerBuilder $container) { $bundle_config = current($container->getExtensionConfig($this->getAlias())); $this->addJWKSets($container, $bundle_config); ConfigurationHelper::addSigner($container, $this->getAlias(), [$bundle_config['signature_algorithm']], false, false); ConfigurationHelper::addVerifier($container, $this->getAlias(), [$bundle_config['signature_algorithm']], false); if (true === $bundle_config['encryption']['enabled']) { ConfigurationHelper::addEncrypter($container, $this->getAlias(), [$bundle_config['encryption']['key_encryption_algorithm']], [$bundle_config['encryption']['content_encryption_algorithm']], ['DEF'], false, false); ConfigurationHelper::addDecrypter($container, $this->getAlias(), [$bundle_config['encryption']['key_encryption_algorithm']], [$bundle_config['encryption']['content_encryption_algorithm']], ['DEF'], false); $encrypter = sprintf('jose.encrypter.%s', $this->getAlias()); $decrypter = sprintf('jose.decrypter.%s', $this->getAlias()); } else { $encrypter = null; $decrypter = null; } ConfigurationHelper::addChecker($container, $this->getAlias(), ['crit'], ['exp', 'iat', 'nbf', 'lexik_iss', 'lexik_aud'], false); ConfigurationHelper::addJWTCreator($container, $this->getAlias(), sprintf('jose.signer.%s', $this->getAlias()), $encrypter); ConfigurationHelper::addJWTLoader($container, $this->getAlias(), sprintf('jose.verifier.%s', $this->getAlias()), sprintf('jose.checker.%s', $this->getAlias()), $decrypter, false); }
/** * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container * @param string $service_name * @param array $bundle_config */ private function updateJoseBundleConfigurationForVerifier(ContainerBuilder $container, $service_name, array $bundle_config) { ConfigurationHelper::addVerifier($container, $service_name, $bundle_config['signature_algorithms'], false); }