0

我想将 LDAP 集成到我的 spring 应用程序中。

要求:- 根据要求,它应该转到我的登录页面,然后询问用户/密码。然后在提交时应该从 LDAP 进行身份验证。

谢谢

4

2 回答 2

0

除此之外,您还需要像这样的其他 LDAP 配置

            <ldap-server url="ldap://localhost:10389/dc=example,dc=com" />


            <authentication-manager alias="authenticationManager"
                erase-credentials="true">
                <ldap-authentication-provider
                    user-dn-pattern="uid={0},ou=people" group-search-base="ou=groups"
                    group-search-filter="(members={0})">
                </ldap-authentication-provider>
            </authentication-manager>
于 2014-02-20T11:37:39.927 回答
0

为此,Spring 中有一个名为Spring Security的特殊项目。核心功能构建为一组 servlet API 过滤器。用户的数据库有多个连接器(LDAP、DB、Active Directory 等)。在这里您可以看到如何添加基本配置。您的 conf 可能如下所示:

  <http use-expressions="true">
    <intercept-url pattern="/**" access="isAuthenticated()" />
    <form-login />
    <logout />
  </http>

请注意,对于安全规则,我更喜欢SpEL 表达式。在这里您可以看到如何添加 LDAP。

希望能帮助到你。

于 2013-09-02T08:47:46.820 回答