Note that there are some explanatory texts on larger screens.

plurals
  1. POsymfony2 listener not called
    primarykey
    data
    text
    <p>Im trying to implement this bundle: <a href="https://github.com/BorisMorel/LdapBundle" rel="nofollow">https://github.com/BorisMorel/LdapBundle</a></p> <p>I have every thing setup and worked except for the listener - it just wont run and profiler is showing the following:</p> <pre><code>Not Called Listeners Event name Listener imag_ldap.security.authentication.pre_bind LdapSecurityListener::onPreBind kernel.exception ExceptionListener::onKernelException kernel.exception ProfilerListener::onKernelException kernel.exception ExceptionListener::onKernelException kernel.view TemplateListener::onKernelView </code></pre> <p>This is my service.yml:</p> <pre><code>services: ldap.listener: class: Riviera\PlutusBundle\EventListener\LdapSecurityListener tags: - {name: kernel.event_listener, event: imag_ldap.security.authentication.pre_bind, method:onPreBind} </code></pre> <p>And this is my listener:</p> <pre class="lang-php prettyprint-override"><code>&lt;?php namespace Riviera\PlutusBundle\EventListener; //use Symfony\Component\EventDispatcher\EventSubscriberInterface; use IMAG\LdapBundle\Event\LdapUserEvent; /** * Performs logic before the user is found to LDAP */ class LdapSecurityListener { /** * Modifies the User before binding data from LDAP * * @param \IMAG\LdapBundle\Event\LdapUserEvent $event */ public function onPreBind(LdapUserEvent $event) { $user = $event-&gt;getUser(); $config = $this-&gt;appContext-&gt;getConfig(); throw new \Exception(sprintf('Username: %s', $user-&gt;getUsername())); } } </code></pre> <p>I have been trying for hours and I have been debugging the bundle code and can 100% say that its connecting to LDAP and failing on the following :</p> <pre class="lang-php prettyprint-override"><code>//IMAG\LdapBundle\Provider\LdapAuthenticationProvider.php try { $this-&gt;dispatcher-&gt;dispatch(LdapEvents::PRE_BIND, $userEvent); } catch (\Exception $expt) { if ($this-&gt;hideUserNotFoundExceptions) { throw new BadCredentialsException('Bad credentials', 0, $expt); } throw $expt; } </code></pre> <p>Any Thoughts/Ideas?</p> <p><strong>EDIT</strong></p> <p>As Per the comment below, the listener is not called and i think that the ldap functionality is reliant on having the listener called. </p> <p>if i put a <code>die()</code> statement before that <code>try{}catch{}</code> i can see it in the browser, however if i put it after the die statement never fires, which means that its throwing the bad credentials exception.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload