How to set url to configure LDAP spring security? There are many XML based examples, but I cannot find a java configuration example for replication below the xml line. I assume it is configured in the bottom block of java code taken from the spring manual to use the built-in ldap, but how do we set the external url?
<ldap-server id="ldapServer" url="ldap://example.com:PORT/dc=example,dc=com" />
@Override
public void init(AuthenticationManagerBuilder auth) throws Exception {
auth.ldapAuthentication()
.userDnPatterns("uid={0},ou=people")
.groupSearchBase("ou=groups")
.contextSource()
.ldif("classpath:test-server.ldif");
}
source
share