【问题标题】:Spring boot LDAP auto configuration - anonymous accessSpring Boot LDAP 自动配置——匿名访问
【发布时间】:2018-11-17 14:28:22
【问题描述】:

如果ldap服务器允许匿名访问,如何配置以下属性。

spring.ldap.用户名 spring.ldap.password

如果我忽略这些属性,我会得到空指针异常,因为使用了内部哈希表。

【问题讨论】:

  • 我认为spring.ldap.anonymous-read-only = true 可以工作
  • 没用。
  • 如果你提供一个假用户/密码并结合匿名只读怎么办?
  • 它正在尝试绑定该用户并失败
  • spring.ldap.anonymous-read-only: true in my application.yml 完全适用于 Spring Boot 2 和 spring-ldap 2.3.2

标签: spring-boot spring-security


【解决方案1】:

我遇到了来自另一个项目和 Spring boot 2.1 和 Spring boot admin 的 Spring ldap 安全性的短暂依赖的相同问题。我的 LDAP 未配置(使用 Spring Boot),并且 Spring Boot 管理控制台启动了健康检查。由于 Spring 引导自动配置,启用了 LDAP 健康检查 bean,然后检查运行到 NullPointerException。

对于这种情况,我通过@SpringBootApplication 排除了 LdapHealthIndicatorAutoConfiguration.class。

对于您的问题,您可能需要更多排除项。请参考https://docs.spring.io/spring-boot/docs/current/reference/html/auto-configuration-classes.html 了解现有的自动配置类。搜索 LDAP 并尝试在您的应用程序中排除找到的类。

我很确定这是 Spring LDAP 安全性中的一个错误,因为匿名 LDAP 配置(无用户和密码)旨在工作。

【讨论】:

    【解决方案2】:

    我认为,this 应该可以使用。只是不要提供会员详细信息。

    【讨论】:

      猜你喜欢
      • 2017-10-20
      • 2018-08-08
      • 2017-01-19
      • 2018-09-09
      • 2018-09-06
      • 1970-01-01
      • 1970-01-01
      • 2019-05-03
      • 1970-01-01
      相关资源
      最近更新 更多