Spring LDAP integration with Spring Boot
Note
|
This project is not under development. Spring LDAP support is provided by Spring Boot out-of-the-box since 1.5.0.RELEASE. For more info visit LDAP support in Spring Boot |
This project is built on top of spring-ldap project. This project provide auto-configuration for spring-ldap
.
Dependency
Maven:
<dependency>
<groupId>com.github.eddumelendez.ldap</groupId>
<artifactId>ldap-spring-boot-starter</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
Gradle:
compile "com.github.eddumelendez.ldap:ldap-spring-boot-starter:1.0.0.RELEASE"
Properties
The following properties are available to customize the ContextSource
.
ldap.urls= # LDAP urls
ldap.base= # Base suffix from which all operations should originate.
ldap.username= # Login user of the LDAP.
ldap.password= # Login password of the LDAP.
ldap.base-environment.*= # LDAP custom environment properties.
Using Embedded LDAP server
Unboundid SDK LDAP is provided as a embedded LDAP server and it’s auto-configured if the dependency is detected.
Add the following dependency:
Maven:
<dependency>
<groupId>com.unboundid</groupId>
<artifactId>unboundid-ldapsdk</artifactId>
<version>3.1.1</version>
<scope>test</scope>
</dependency>
Gradle:
testCompile "com.unboundid:unboundid-ldapsdk:3.1.1"
You can use the following properties to customize the embedded server:
ldap.embedded.port= # Embedded LDAP port. Use 0 for random port.
ldap.embedded.credential.username= # Embedded LDAP username.
ldap.embedded.credential.passwod= # Embedded LDAP password.
ldap.embedded.partitionSuffix= # LDAP partition suffix.
ldap.embedded.ldif= # Schema (LDIF) script resource reference.
Examples
You can check the examples here.