【问题标题】:Spring Security and multiple LDAPSpring Security 和多个 LDAP
【发布时间】:2015-10-12 17:25:50
【问题描述】:

我有一个场景,我们必须连接到多个 LDAP,假设每个 LDAP 都可能用于不同的国家。如果用户尝试登录,则必须验证该用户是否在任何 LDAP 中设置,以便他可以通过为该 LDAP 定义的角色进行身份验证并授予访问权限。使用 Spring 安全框架可以吗?

【问题讨论】:

    标签: spring spring-security ldap spring-ldap


    【解决方案1】:

    是的,您可以针对多个 LDAP 服务器进行身份验证。如果您想简单地尝试每个 LDAP 实例,您可以执行以下操作:

    <ldap-server id="exampleLdap" url="ldap://example.org:389/dc=springframework,dc=org" />
    <ldap-server id="springLdap" url="ldap://springframework.org:389/dc=springframework,dc=org" />
    
    <authentication-manager>
        <ldap-authentication-provider user-search-filter="(uid={0})"
           user-search-base="ou=people"
           server-ref="exampleLdap"/>
        <ldap-authentication-provider user-search-filter="(uid={0})"
           user-search-base="ou=people"
           server-ref="springLdap"/>
    </authentication-manager>
    

    【讨论】:

      猜你喜欢
      • 2012-06-04
      • 2018-11-03
      • 1970-01-01
      • 2018-04-15
      • 2014-09-04
      • 2012-10-15
      • 2011-09-23
      • 2012-05-19
      • 1970-01-01
      相关资源
      最近更新 更多