1.首先在项目pom.xml文件引用maven依赖包:
<!-- spring-ldap -->
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>2.3.2.RELEASE</version>
</dependency>
2.然后在项目的properties配置文件和ldap.xml填写相关配置信息:
#ldap
ldap.url=ldap://192.168.0.1:389
ldap.base=dc=scop,dc=cn
ldap.basePath=ou=Users,domainName=yaochung,o=domains
ldap.username=cn=Manager,dc=scop,dc=cn
ldap.password=666666
ldap.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ldap="http://w