Following is a typical example of what I've found on the Internet for Authenticating to Active Directory using LDAP.

package com.test; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider; @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { ActiveDirectoryLdapAuthenticationProvider adProvider = new ActiveDirectoryLdapAuthenticationProvider("domain.org", "ldap://activedirectory-url:389"); adProvider.setConvertSubErrorCodesToExceptions(true); adProvider.setUseAuthenticationRequestCredentials(true); auth.authenticationProvider(adProvider); } } 

Let's say I have a user XYZ with password 123 which I enter into the login form. How would this security configuration pickup my credentials and verify them against the Active Directory server?

Why does Active Directory not require a ManagerDn, ManagerPassword, or Username or Userpassword. I fail to understand how it would Authenticate without the aforementioned information.

Normally with ldapAuthentication I would provide such details in the ContextSource, like so:

but I can't seem to find how do this with ActiveDirectoryLdapAuthenticationProvider .

I checked the class's documentation and was unable to understand how it receives and processes the userCredentials

1

Related questions 0 Need help setting up properties for ActiveDirectoryLdapAuthenticationProvider 0 LDAP authentication using Spring security 2.0.3 1 Spring security LDAP Authentication without specifying authentication details in the configuration file Related questions 0 Need help setting up properties for ActiveDirectoryLdapAuthenticationProvider 0 LDAP authentication using Spring security 2.0.3 1 Spring security LDAP Authentication without specifying authentication details in the configuration file 6 ActiveDirectoryLdapAuthenticationProvider and final modifier 0 Spring Boot LDAP Authentication 2 LDAP authentication in spring boot app 1 ActiveDirectoryLdapAuthenticationProvider | How to provide Principal creds 1 Do we need to write CustomActiveDirectoryLdapAuthenticationProvider if we want to get user details from ActiveDirectory 2 Authentication with Spring-Security via Active Directory LDAP 6 Spring authentication using ActiveDirectoryLdapAuthenticationProvider and embedded ldif Load 7 more related questions Show fewer related questions

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.