【发布时间】:2017-05-04 05:04:15
【问题描述】:
我使用的是 Spring 3.1 版本。
我已经实现了 Spring Security 以登录我的门户网站。它工作正常,除了一个问题。我已将会话超时设置为 2 分钟。
一旦发生超时,然后用户单击任何 URL,它就会被重定向到注销页面。但是当用户重新认证时,用户直接登陆默认目标URL的主页而不是最后访问页面。
如果用户访问/home/editproduct,那么在超时后&当他再次重新验证时,他应该访问home/editproduct,而不仅仅是/home页面。
这是我的 applicationcontext.xml 文件:
<bean id="myNeAdminUserNamePasswordAuthFilter"
class="com.ne.mynelson.authentication.adminuser.MyNeAdminUserPasswordAuthFilter">
<property name="authenticationManager" ref="myNeAdminUserAuthManager" />
<property name="authenticationFailureHandler" ref="adminFailureHandler" />
<property name="authenticationSuccessHandler" ref="adminSuccessHandler" />
<property name="authenticationInputProcessor" ref="myNeAdminUserAuthInputProcessor"></property>
</bean>
<bean id="adminSuccessHandler"
class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler">
<property name="defaultTargetUrl" value="/bookShelfController.htm" />
<property name="useReferer" value="true"/>
</bean>
<bean id="adminFailureHandler"
class="com.ne.mynelson.authentication.adminuser.AdminUrlAuthenticationFailureHandler">
<property name="defaultFailureUrl" value="/adminlogin.htm"></property>
</bean>
【问题讨论】:
标签: spring-security