具有GSS协商的Spring安全性LDAP

时间:2016-07-11 07:47:03

标签: spring-security ldap gssapi

我正在尝试使用带有ldap的spring security 4。它适用于作为基本身份验证系统的LDAP。如果我尝试连接到使用GSS的系统不再有效。我认为这是正常的,应该在某处使用GSS指定。但在哪里?

以下是xml文件安全性

<?xml version="1.0" encoding="UTF-8"?>
<beans:bean xmlns="http://www.springframework.org/schema/security"
       xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-4.1.xsd
    ">

    <!-- This is where we configure Spring-Security  -->
    <http auto-config="true" use-expressions="true">

        <intercept-url pattern="/" access="permitAll" />
        <intercept-url  pattern="/login" access="permitAll" />
        <intercept-url  pattern="/logout" access="isAuthenticated()" />
        <intercept-url  pattern="/user**" access="hasAuthority('1')" />


        <access-denied-handler error-page="/403" />
        <form-login
                login-page="/login"
                default-target-url="/planning"
                authentication-failure-url="/login?error"
                username-parameter="username"
                password-parameter="password"
                authentication-success-handler-ref="customLdapAuthenticationSuccessHandler"
        />
        <logout logout-url="/logout" logout-success-url="/login?logout" />

    </http>


    <ldap-server   url="ldap://192.168.2.100/DC=ciro,DC=local,DC=it?one?(objectClass=*)" manager-dn="cn=Administrator,dc=web-gate,dc=local,dc=it"  manager-password="PLAIN PWD" />

    <authentication-manager>
        <ldap-authentication-provider
                group-search-base="ou=groups">
        </ldap-authentication-provider>
    </authentication-manager>
</beans:bean>

1 个答案:

答案 0 :(得分:0)

Spring LDAP从未支持GSSAPI SASL机制。幸运的是,您可以使用my library来实现Spring LDAP。配置很简单。