b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

ldap认证_ldap认证服务器_ldap认证服务器搭建(3)

电脑杂谈  发布时间:2017-02-23 04:55:02  来源:网络整理

下面说说我们主要的内容 LDAP 进行身份认证部分:

首选我们指定 authentication-manager 为一个 LDAP 的 authentication provider。

    <bean id="ldapAuthProvider"
        class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider" >
        ……
    </bean>
        ……
    <s:authentication-manager>
        <s:authentication-provider ref="ldapAuthProvider">
        </s:authentication-provider>
    </s:authentication-manager>

这个 LdapAuthenticationProvider 有两个构造参数:

LdapAuthenticator authenticator:这是一个验证器,验证绑定策略

LdapAuthoritiesPopulator authoritiesPopulator:这个是在用户通过验证后,得到权限。这个眼熟吧?就是上面我说的在这里我没法得到 session 。

现在我们再看 ldapAuthProvider 的完整配置:

<bean id="ldapAuthProvider"
    class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider" >
    <constructor-arg>
        <bean id="authenticator"
            class="org.springframework.security.ldap.authentication.BindAuthenticator">
            <constructor-arg ref="contextSource" />
            <property name="userSearch">
                <bean
                    class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch">
                    <constructor-arg value="" />
                    <constructor-arg value="${security.ldap.searchFilter}" />
                    <constructor-arg ref="contextSource" />
                </bean>
            </property>
        </bean>
    </constructor-arg>
    <constructor-arg>
        <bean id="authoritiesPopulator"
            class="net.bookong.ldapsample.security.LdapAuthoritiesPopulatorImpl">
        </bean>
    </constructor-arg>
</bean>


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-33983-3.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...