app/src/ApiBundle/ApiBundle.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\ApiBundle;
  3. use App\ApiBundle\Security\HmacFactory;
  4. use Symfony\Component\DependencyInjection\ContainerBuilder;
  5. use Symfony\Component\HttpKernel\Bundle\Bundle;
  6. class ApiBundle extends Bundle
  7. {
  8.     public function build(ContainerBuilder $container): void
  9.     {
  10.         parent::build($container);
  11.         // $hmacFactory should implement \Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface
  12.         // @see http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html#the-factory
  13.         $hmacFactory = new HmacFactory();
  14.         $extension $container->getExtension('security');
  15.         $extension->addSecurityListenerFactory($hmacFactory);
  16.     }
  17. }