Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 这两种配置的区别是什么?_Spring_Security_Ldap - Fatal编程技术网

Spring 这两种配置的区别是什么?

Spring 这两种配置的区别是什么?,spring,security,ldap,Spring,Security,Ldap,我正在使用SpringSecurity,我有两种配置要尝试。在我的security-config.xml中,我有以下内容可以根据LDAP对用户进行身份验证 <authentication-manager alias="authenticationManager"> <ldap-authentication-provider server-ref="ldapLocal" user-search-filter="(| (userPrincipalName={

我正在使用SpringSecurity,我有两种配置要尝试。在我的security-config.xml中,我有以下内容可以根据LDAP对用户进行身份验证

<authentication-manager alias="authenticationManager">
    <ldap-authentication-provider server-ref="ldapLocal"
        user-search-filter="(| (userPrincipalName={0}) (sAMAccountName={0}))" user-search-base="CN=particion1,DC=prueba,DC=com">
    </ldap-authentication-provider>
我的属性文件中有此配置

app.ad-domain=prueba
app.ad-server=ldap://localhost/
app.ad-rootdn=CN=particion1,DC=prueba,DC=com
app.service-principal=HTTP/localhost@prueba
app.keytab-location=/tmp/tomcat.keytab
app.ldap-search-base=CN=particion1,DC=prueba,DC=com
app.ldap-search-filter="(| (userPrincipalName={0}) (sAMAccountName={0}))"
我可以称之为属性吗?或者有人能帮我在xml文件中使用这个配置吗

更新

现在我有了这个配置

<authentication-manager alias="authenticationManager">
    <ldap-authentication-provider
        user-search-filter="(| (userPrincipalName={0}) (sAMAccountName={0}))" user-search-base="CN=particion1,DC=prueba,DC=com"></ldap-authentication-provider>
</authentication-manager>

<ldap-server url="ldap://192.168.5.2"
    manager-dn="CN=part1,DC=test,DC=com" manager-password="" />
根据它与用户/密码/帐户pb相关

那么您确定属性文件正在工作吗?因为我看不到xml文件和属性文件之间的区别

这是一个适合我的配置:

<authentication-manager alias='authenticationManager'>
<ldap-authentication-provider user-search-filter='(uid={0})' user-search-base='${myserviceservice.user.search.base}></ldap-authentication-provider>
</authentication-manager>

<ldap-server url="${myservice.read.scheme}://${myservice.read.host}" manager-dn="${myservice.nontrans.user}" manager-password="dummy-password" />


谢谢你的回答,但是我在LDAP中没有任何密码来验证我需要禁用这个选项,我想是的。。
Configuration problem: You must specify the manager-password if you supply a CN=test,DC=prueba,DC=com
<authentication-manager alias='authenticationManager'>
<ldap-authentication-provider user-search-filter='(uid={0})' user-search-base='${myserviceservice.user.search.base}></ldap-authentication-provider>
</authentication-manager>

<ldap-server url="${myservice.read.scheme}://${myservice.read.host}" manager-dn="${myservice.nontrans.user}" manager-password="dummy-password" />