silex 설명서 - Defining a custom Authentication Provider을 사용하여 LDAP 인증을위한 사용자 지정 인증 공급자를 작성하려고합니다.silex 응용 프로그램의 사용자 지정 인증 공급자
그러나 $app['security.authentication_providers']
을 보면 두 개의 제공자가 있습니다. 내가 App\LdapAuthenticationProvider
을 정의 하나 Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider
하나 내가 사용자에게 권한을 부여 할 때 클래스 DaoAuthenticationProvider가에서 App\LdapUserProvider::loadUserByUsername()
의 호출이 있기 때문에 나는 오류가 발생합니다.
$app['security.authentication_providers']
에 하나의 공급자 만 있다면 LDAP 공급자가 loadUserByUsername을 호출하지 않아서 오류가 발생하지 않아야한다고 생각합니다. 여기
그래서 $app['security.authentication_providers']
array (size=2)
0 => object(App\LdapAuthenticationProvider)[194]
private 'userProvider' =>
object(App\LdapUserProvider)[176]
private 'ldap' => resource(57, ldap link)
private 'defaultRoles' =>
array (size=1)
...
private 'providerKey' => string 'default' (length=7)
1 => object(Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider)[195]
private 'encoderFactory' =>
object(Symfony\Component\Security\Core\Encoder\EncoderFactory)[197]
private 'encoders' =>
array (size=1)
...
private 'userProvider' =>
object(App\LdapUserProvider)[176]
private 'ldap' => resource(57, ldap link)
private 'defaultRoles' =>
array (size=1)
...
private 'hideUserNotFoundExceptions' (Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider) => boolean true
private 'userChecker' (Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider) => object(Symfony\Component\Security\Core\User\UserChecker)[196]
private 'providerKey' (Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider) => string 'default' (length=7)
의 덤프, 여분의 제공이 왜 누군가가 알고 않으며, 어떻게 내가 그것을 제거 할 수있다?
bootstraping application, LdapAuthenticationListener 및 LdapAuthenticationProvider에 대한 코드가 있습니다.
그러나 여전히''$ app [ 'security.authentication_providers']''에는 두 개의 제공자가 있습니다. – vansanblch
최종 코드를 게시 할 수 있습니까? – heapOverflow
불행히도 나는 할 수 없다. 이 프로젝트는 현재 철회되었으며 그것에 접근하지 못했습니다. 하지만 주 아이디어는 UsernamePasswordFormAuthenticationListener에서 확장하여 보관 한 올바른 LdapAuthenticationListener를 작성하는 것이 었습니다. 또한 부트 스트랩에 ldap 인증을 처리 할 새 팩토리를 등록하는 코드가 있습니다. 또한 pastebin에서 코드를 살펴보고, linku가 첫 번째 주석에서 발견 될 수 있습니다. 나는이 클래스들에서 코드를 너무 많이 변경하지 않았다고 생각한다. – vansanblch