मैं सिलेक्स दस्तावेज़ - Defining a custom Authentication Provider का उपयोग कर एलडीएपी प्रमाणीकरण के लिए कस्टम प्रमाणीकरण प्रदाता लिखने का प्रयास करता हूं।साइलेक्स अनुप्रयोग में कस्टम प्रमाणीकरण प्रदाता
लेकिन यदि मैं $app['security.authentication_providers']
में देखता हूं तो दो प्रदाता होते हैं। और एक यह है कि मैं App\LdapAuthenticationProvider
परिभाषित और एक Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider
जब मैं उपयोगकर्ता अधिकृत करने का प्रयास वर्ग DaoAuthenticationProvider से एक App\LdapUserProvider::loadUserByUsername()
की कॉल न होने के कारण मैं त्रुटि मिलती है।
यदि मेरे पास $app['security.authentication_providers']
में केवल एक प्रदाता होगा तो मुझे लगता है कि मुझे त्रुटि नहीं मिलनी चाहिए क्योंकि मेरा एलडीएपी-प्रदाता 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 के लिए कोड हैं।
हालांकि, अभी भी नहीं मिल सकता है कि '' ऐप ['security.authentication_providers'] '' में दो प्रदाता हैं। – vansanblch
क्या आप अपना अंतिम कोड पोस्ट कर सकते हैं? – heapOverflow
दुर्भाग्य से मैं नहीं कर सकता। इस परियोजना को अभी वापस ले लिया गया है और मुझे इसकी पहुंच नहीं है। लेकिन मुख्य विचार सही LdapAuthenticationListener लिखना था जिसे मैंने इसे UserernamePasswordFormAuthenticationListener से विस्तारित करके संग्रहीत किया था। और ldap-प्रमाणीकरण को संभालने के लिए नए कारखाने को पंजीकृत करने के लिए बूटस्ट्रैप में एक कोड है। पेस्टबिन पर भी कोड देखें, लिंकू पहली टिप्पणी में पाया जा सकता है। मुझे लगता है कि मैंने इन वर्गों में कोड को बहुत ज्यादा नहीं बदला है। – vansanblch