im currently working of a Spring MVC web application and we have been using authtication via a local database with an impl of the AbstractUserDetailsAuthenticationProvider class provided by spring security.
However, to secure the app further, we decided to allow users to authenticate via LDAP/AD server. This would not be a requirement and users can choose to enable this in the configurations in the portal itself.
Wondering how would one actually go around implementing this. Have found the AbstractLdapAuthenticationProvider. However, just to add this additional authentication provider to the authentication manager would not suffice as weather or not it should be there should be determined at runtime by a flag in the database.
Would really appreciate any help in this area.
Thanks for reading:)