> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/iv.-spring-boot-features/30.-working-with-nosql-technologies/30.9-ldap/30.9.1-connecting-to-an-ldap-server.md).

# 30.9.1 连接LDAP服务器

为了连接LDAP服务器，你需要确保声明了`spring-boot-starter-data-ldap`“Starter”或者`spring-ldap-core`依赖，然后在你的`application.properties`中声明你的服务器的URL。如下所示：

```
spring.ldap.urls=ldap://myserver:1235
spring.ldap.username=admin
spring.ldap.password=secret
```

如果你需要自定义连接设置，你可以使用`spring.ldap.base`或者`spring.ldap.base-environment`属性。
