Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom authentication provider in silex application
    primarykey
    data
    text
    <p>I try to write custom authentication provider for LDAP-authentication using silex documentation - <a href="http://silex.sensiolabs.org/doc/providers/security.html#defining-a-custom-authentication-provider">Defining a custom Authentication Provider</a>.</p> <p>But if I look into <code>$app['security.authentication_providers']</code> there are two providers. One that I defined <code>App\LdapAuthenticationProvider</code> and one <code>Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider</code></p> <p>And when I try to authorize user I get error because there is call of a <code>App\LdapUserProvider::loadUserByUsername()</code> from class DaoAuthenticationProvider.</p> <p>If I would have only one provider in <code>$app['security.authentication_providers']</code> I think I should not get error because my LDAP-provider do not call loadUserByUsername.</p> <p>Here is dump of <code>$app['security.authentication_providers']</code> </p> <pre><code>array (size=2) 0 =&gt; object(App\LdapAuthenticationProvider)[194] private 'userProvider' =&gt; object(App\LdapUserProvider)[176] private 'ldap' =&gt; resource(57, ldap link) private 'defaultRoles' =&gt; array (size=1) ... private 'providerKey' =&gt; string 'default' (length=7) 1 =&gt; object(Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider)[195] private 'encoderFactory' =&gt; object(Symfony\Component\Security\Core\Encoder\EncoderFactory)[197] private 'encoders' =&gt; array (size=1) ... private 'userProvider' =&gt; object(App\LdapUserProvider)[176] private 'ldap' =&gt; resource(57, ldap link) private 'defaultRoles' =&gt; array (size=1) ... private 'hideUserNotFoundExceptions' (Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider) =&gt; boolean true private 'userChecker' (Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider) =&gt; object(Symfony\Component\Security\Core\User\UserChecker)[196] private 'providerKey' (Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider) =&gt; string 'default' (length=7) </code></pre> <p>So, does anybody know why there are extra provider and how can I get rid of it?</p> <p>There are code for <a href="http://pastebin.com/4dcsnziH">bootstraping application</a>, <a href="http://pastebin.com/JthKyCQU">LdapAuthenticationListener</a> and <a href="http://pastebin.com/LZuDWLQD">LdapAuthenticationProvider</a>.</p>
    singulars
    1. This table or related slice is empty.
    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