I am trying to test Active Directory authentication with Spring Boot. I have an Active Directory working and I can access to it via LDAP browsers for my admin user with that user dn:
CN=Administrator,CN=Users,DC=contoso,DC=com
I want to use LDAP as authentication manager at my application. Simple example from docs is as follows:
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.userDnPatterns("CN={0},CN=Users,DC=contoso,DC=com")
.groupSearchBase("ou=groups")
.contextSource()
.managerDn("CN=Administrator,CN=Users,DC=contoso,DC=com")
.managerPassword("myadminpassword")
.url("ldap://192.168.1.1:389");
}
First of all, should I provide admin password to connect Active Directory such a login?
Secondly, should I provide groupSearchBase and userDnPatterns and how?