I'm using a combination of spring-ldap and spring-boot-starter security. I have configured the basic setup but stuck at passing username and password to be authenticated. Its always trying to authenticate the default creds specified in the application.properties. Is there anyway to do this properly by passing the creds given in the login form.
@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception {
if(Boolean.parseBoolean(ldapEnabled)) {
auth
.ldapAuthentication()
.contextSource()
.url(ldapUrls + ldapBaseDn)
.managerDn(ldapSecurityPrincipal)
.managerPassword(ldapPrincipalPassword)
.and()
.userDnPatterns(ldapUserDnPattern);
}
}
ldap.urls= ldap://localhost:10389/
ldap.base.dn= ou=users,dc=example,dc=com
ldap.username= cn=test, ou=users,dc=example,dc=com
ldap.user.dn.pattern = cn={0}
ldap.partitionSuffix=dc=example,dc=com
ldap.partition=example
ldap.principal=uid=admin,ou=system
ldap.password=secret
ldap.port=10389
ldap.url=ldap://localhost:10389/