I am trying to integrate LDAP based login in my Spring Boot application.
As initial step, I am trying to use this LDAP server (http://www.forumsys.com/tutorials/integration-how-to/ldap/online-ldap-test-server/).
But, I am unable to successfully connect with the server and getting this error.
nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
I am using this information in configuration class.
authenticationManagerBuilder.ldapAuthentication()
.contextSource().url("ldap://ldap.forumsys.com:389/dc=example,dc=com")
.managerDn("cn=read-only-admin,dc=example,dc=com").managerPassword("password")
.and()
.userSearchBase("ou=mathematicians")
.groupSearchBase("ou=mathematicians")
.userSearchFilter("(cn={0})");
And this is my application.properties file for this project.
spring.ldap.urls=ldap.forumsys.com:389
spring.ldap.base=cn=read-only-admin,dc=example,dc=com
spring.ldap.password=password
Can anyone provide a working configuration for a Spring Boot application using an LDAP server?