I'm using Symfony framework v 2.4.2 to update an existing website which performs a double check to log users in:
- first, it checks if the username and password belong to a valid Active Directory user (using PHP's
ldap_bind()function); - if so, it checks the username only against a DB table (no password is stored in the DB);
- if the username is found in the DB table, the website loads the user profile from DB, and the user is authenticated.
How can I replicate this auth process in Symfony2?
So far, I got stuck with FOSUserBundle and FR3DLdapBundle: I managed to use chained providers (ldap and db), but seemingly LDAP credentials are completely ignored: users can login with the credentials stored in the DB, even if the ldap_bind() fails - which is the exact opposite of points 1 & 2.
Besides, when using FOSUserBundle, it seems to be mandatory to store passwords inside the DB.
Please pay attention to point no. 2: users must be free to change their LDAP password from outside the website (that is, from Active Directory), and then log in with the new credentials- without any update to the website's users database.
Any solution is welcome, I'm not so much in love with FOSUserBundle and even less with FR3DLdapBundle.