【问题标题】:Spring LDAP Authentication using uniqueMember Attribute使用 uniqueMember 属性的 Spring LDAP 身份验证
【发布时间】:2018-10-24 14:41:19
【问题描述】:

当我尝试使用 uid={0},ou=Groups 进行身份验证时,我可以成功登录,但当我尝试将模式缩小到特定时却无法登录组。
uid={0},CN=ROM,OU=USER,OU=APPOU,ou=Groups

我可能需要使用 uniqueMember 属性但找不到方法。如何仅使用组的 uniqueMember 属性对用户进行身份验证?

@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth
        .ldapAuthentication()
        .contextSource()
            .url("ldapUrl")
                .managerDn("username")
                .managerPassword("password")
            .and()
                .userDnPatterns("uid={0},CN=ROM,OU=USER,OU=APPOU,ou=Groups");
}

【问题讨论】:

    标签: spring-boot spring-ldap spring-security-ldap


    【解决方案1】:

    以下是感兴趣的人的方式:

     public void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth
        .ldapAuthentication()
        .contextSource()
            .url(ldapUrl")
                .managerDn("username")
                .managerPassword("password")
            .and()
                .userSearchFilter("uid={0}")
                .groupSearchBase("CN=ROM,OU=USER,ou=APPOU,ou=Groups")
                .groupSearchFilter("uniqueMember{0}");
    

    }

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-09
      • 2022-01-20
      • 2017-04-12
      • 1970-01-01
      • 2014-02-28
      • 2011-12-05
      • 2012-10-10
      • 2012-02-18
      相关资源
      最近更新 更多