我有一个连接到LDAP服务器的Web应用程序,一切正常,直到现在在LDAP中创建一个新分支并处理URL我得到"错误302暂时移动"。我从来没有这样的事情,我在.properties中配置了LDAP服务器。
奇怪的是我的配置非常好,但是现在你创建了一个新的分支进行测试,我得到了这个错误。
如果我可以提供帮助的话,那将是导致这种情况发生的原因。这些是我的档案。
使用此配置
#Properties LDAP Server
ldap.context.initialContextFactory = com.sun.jndi.ldap.LdapCtxFactory
ldap.context.providerUrl = ldap://192.168.0.31:389/dc=store,dc=web,dc=ap
ldap.context.securityAuthentication = simple
ldap.context.securityPrincipal = cn=admin,dc=web,dc=ap
ldap.context.securityCredentials = adm5569
使用此配置,我发送HTTP错误302暂时移动
#Properties LDAP Server
ldap.context.initialContextFactory = com.sun.jndi.ldap.LdapCtxFactory
ldap.context.providerUrl = ldap://192.168.0.31:389/dc=store2,dc=web,dc=ap
ldap.context.securityAuthentication = simple
ldap.context.securityPrincipal = cn=admin,dc=web,dc=ap
ldap.context.securityCredentials = adm5569
这是我的security.xml文件
<beans:beans 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-3.1.xsd">
<http pattern="/webapp/ViewChangePassword" security="none" />
<http pattern="/webapp/LogonForm" security="none" />
<http auto-config="true">
<intercept-url pattern="/webapp/Home" access="ROLE_USER" />
<intercept-url pattern="/webapp/ListStore" access="IS_AUTHENTICATED_ANONYMOUSLY, ROLE_USER" />
<intercept-url pattern="/webapp/CheckStoreJson" access="IS_AUTHENTICATED_ANONYMOUSLY, ROLE_USER" />
<intercept-url pattern="/webapp/ViewChangePassword" access="IS_AUTHENTICATED_ANONYMOUSLY, ROLE_USER" />
<intercept-url pattern="/webapp/ChangePassword" access="IS_AUTHENTICATED_ANONYMOUSLY, ROLE_USER" />
<intercept-url pattern="/webapp/**" access="ROLE_USER" />
<form-login login-page="/webapp/LogonForm" default-target-url="/webapp/Home" authentication-failure-url="/webapp/LogonForm?code=1" login-processing-url="/webapp/LogOn" />
<logout logout-url="/webapp/LogOut" logout-success-url="/webapp/LogonForm?code=2" />
</http>
<authentication-manager>
<authentication-provider ref="ldapAuthProvider"/>
</authentication-manager>
<ldap-server id="ldapServer" url="ldap://${ldap.server.ip}:${ldap.server.port}/${ldap.server.root}"/>
<beans:bean class="org.springframework.security.ldap.authentication.BindAuthenticator" id="ldapBindAuthenticator" >
<beans:constructor-arg ref="ldapServer"/>
<beans:property name="userSearch" ref="userSearch"/>
</beans:bean>
<beans:bean id="userSearch" class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch" >
<beans:constructor-arg index="0" value="ou=usuarios"/>
<beans:constructor-arg index="1" value="(uid={0})"/>
<beans:constructor-arg index="2" ref="ldapServer" />
</beans:bean>
<beans:bean class="org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator" id="ldapAuthoritiesPopulator" >
<beans:constructor-arg ref="ldapServer"/>
<beans:constructor-arg value="${ldap.springrole.rdn}"/>
<beans:property name="groupRoleAttribute" value="${ldap.springrole.attribute}"/>
<beans:property name="rolePrefix" value="${ldap.springrole.prefix}"/>
<beans:property name="groupSearchFilter" value="(objectClass=organizationalRole)"/>
<beans:property name="searchSubtree" value="true" />
</beans:bean>
<beans:bean id="ldapAuthProvider" class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider" >
<beans:constructor-arg ref="ldapBindAuthenticator"/>
<beans:constructor-arg ref="ldapAuthoritiesPopulator"/>
<beans:property name="userDetailsContextMapper" ref="ldapUserDetailsContextMapper"/>
</beans:bean>
<beans:bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
<beans:constructor-arg ref="ldapServer"/>
</beans:bean>
<beans:bean class="cl.bbr.security.UserLdapMapper" id="ldapUserDetailsContextMapper">
<beans:property name="template" ref="ldapTemplate"/>
</beans:bean>
</beans:beans>
编辑(1)29-10-2014
302暂时移动错误出现在调试控制台google Chrome中,尝试通过登录登录,将我重定向到登录错误页面和调试控制台google我认为暂时移动了处理身份验证的URL。
请帮助。
答案 0 :(得分:0)
我找到了解决方案,我必须向分支机构中的用户授予权限,以便阅读,修改和删除分支机构