LdapToolsBundle.php
public function build(ContainerBuilder $container)
    {
        parent::build($container);
        $extension = $container->getExtension('security');
        $extension->addSecurityListenerFactory(new LdapFormLoginFactory());
        $container->addCompilerPass(new EventRegisterPass());
        $container->addCompilerPass(new LdifUrlLoaderPass());
    }
public function build(ContainerBuilder $container)
    {
        parent::build($container);
        $extension = $container->getExtension('security');
        $extension->addSecurityListenerFactory(new LdapFormLoginFactory());
        $container->addCompilerPass(new EventRegisterPass());
        $container->addCompilerPass(new LdifUrlLoaderPass());
    }
Make Symfony aware of the LDAP listener factory and add the compiler pass.

@param ContainerBuilder $container