2013-02-11 171 views
0

我想帶彈簧的安全與LDAP服務器進行身份驗證,這裏是我的security.xml:春天 - LDAP認證

<http auto-config="true" use-expressions="true"> 
    <intercept-url pattern="/index*" access="permitAll" /> 
    <form-login login-page="/login" default-target-url="/index" 
     authentication-success-handler-ref="loginSuccessHandler" 
     authentication-failure-handler-ref="loginFailureHandler" /> 
</http> 

<ldap-server id="ldapServer" 
    url="ldap://example.net:389/DC=example,DC=net" /> 
<authentication-manager> 
    <ldap-authentication-provider server-ref="ldapServer" 
     user-dn-pattern="CN={0}, OU=First,OU=Second,OU=Third> 
    </ldap-authentication-provider> 
</authentication-manager> 

但它拋出一個異常 - 「產生的原因:使用javax。 naming.NamingException:[LDAP:錯誤代碼1 - 000004DC:LdapErr:DSID-0C0906E8,註釋:爲了執行此操作,必須在連接,數據0,v1db1]上完成ful bind的成功;其餘名稱爲'' 「

出了什麼問題?

+0

您沒有綁定到LDAP服務器。 – duffymo 2013-02-11 14:16:59

+0

我該怎麼做?用BindAuthenticator? – Shallow 2013-02-11 14:20:33

+0

https://answers.atlassian.com/questions/52559/crowd-ldap-integration – duffymo 2013-02-11 14:22:24

回答

0

檢查LDAP客戶端是否使用LDAPv3。 LDAPv2要求連接上的第一個操作是BIND操作。一般來說,LDAP客戶端不應使用LDAPv2,現有代碼應修改爲不使用LDAPv2。