繁体   English   中英

Spring身份验证ldap示例和真实的ldap服务器

[英]Spring authenticating ldap example and real ldap server

长时间的聆听者,首次呼叫者。

我已经从以下网址下载了Spring身份验证ldap示例: https : //spring.io/guides/gs/authenticating-ldap/到STS中。 工作正常。

但是,我想尝试使其与真正的ldap数据库一起使用,例如在forumsys.com上提供的那种ldap数据库: http : //www.forumsys.com/en/tutorials/integration-how-到/ ldap / online-ldap-test-server /

我当前对configureGlobal的配置是:

    @Autowired
public void configureGlobal(AuthenticationManagerBuilder authBuilder) throws Exception {

    authBuilder
        .ldapAuthentication()
        .userSearchFilter("(uid={0},dc=example,dc=com)")
        .userSearchBase("")
        .contextSource()
            .url("ldap://ldap.forumsys.com:389/dc=example,dc=com")
       .managerDn("cn=read-only-admin,dc=example,dc=com") 
            .managerPassword("password");

}

当我尝试使用“ tesla /密码”或“ einstein /密码”登录时,这将返回错误的凭据错误。 任何人都可以建议configureGlobal中的哪些设置将导致有效的登录吗?

谢谢,痛

这似乎可行:

authBuilder
            .ldapAuthentication()
            .userSearchFilter("(uid={0})")
            .userSearchBase("")
            .contextSource()
                .url("ldap://ldap.forumsys.com:389/dc=example,dc=com")
           .managerDn("cn=read-only-admin,dc=example,dc=com") 
                .managerPassword("password");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM