0

I am trying to connect to AD using Spring LDAP. I am able to connect to a server with Simple Authentication but for one of the server only GSS-API authentication is active. I am not able to connect to this server using Spring LDAP.

Could someone help guiding me to resolve this issue? Any help is really appreciated!

Below is the my code;

@Configuration
@Profile("prod")
public class AppProdConfig {

@Bean
public LdapContextSource ldapContextSource(){
    LdapContextSource ldapContextSource = new LdapContextSource();
    ldapContextSource.setUrls(new String[]{"ldaps://1.1.1.1:636","ldaps://2.2.2.2:636"});
    ldapContextSource.setBase("ou=users,ou=usersAndGroups,dc=ecommerce,dc=company");
    ldapContextSource.setUserDn("user");
    ldapContextSource.setPassword("password123");

    return ldapContextSource;
}

@Bean
public LdapTemplate ldapTemplate(LdapContextSource ldapContextSource){
    LdapTemplate ldapTemplate = new LdapTemplate(ldapContextSource);
    return ldapTemplate;
}
}

1 Answers1

0

Spring LDAP does not support this. My library will do this for you.

Michael-O
  • 18,123
  • 6
  • 55
  • 121