How to use proxy server while authenticate using LDAP in Spring Boot?

79 Views Asked by At

How to set proxy server ip in LdapContextSource while authenticated using LdapTemplate.authenticate()

Actually for security purposes we don't have direct access to AD server. So how to set proxy IP for this in spring boot?

LdapContextSource contextSource = new LdapContextSource();
contextSource.setUrl("ldap://corp.opustech.net:389");
contextSource.setBase("dc=corp,dc=opustech,dc=net");
contextSource.afterPropertiesSet();

LdapTemplate ldapTemplate = new LdapTemplate(contextSource);
AndFilter filter = new AndFilter();
filter.and(new EqualsFilter("uid", "rahul.i"));
boolean isAuthenticated = ldapTemplate.authenticate("", filter.toString(), "opustech@23");
0

There are 0 best solutions below