spring - 当 Spring Security 中的会话超时时,SavedRequestAwareAuthenticationSuccessHandler 无法按预期工作
问题描述
我4.2.2.RELEASE
在我的应用程序中使用 Spring Security。一旦会话超时发生,然后如果用户单击任何 URL,它将被重定向到注销页面,一旦身份验证成功,它会重定向到默认主页,而不是先前请求的页面。
因此,我尝试通过将以下配置添加到 servlet.xml 文件来解决此问题。
<security:form-login
login-page="/login"
authentication-failure-url="/login_error"
username-parameter="username"
password-parameter="password"
always-use-default-target="false"
authentication-success-handler-ref="authenticationSuccessHandler"
/>
<security:intercept-url pattern="/login" access="permitAll"/>
<bean id="authenticationSuccessHandler" class="org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler">
<property name="useReferer" value="true" />
</bean>
这里可能出了什么问题?请有人解释为什么这不起作用?
解决方案
推荐阅读
- ios - Swift:iPhone 上的安全区域
- kubernetes - k8s yaml文件中标签策略的不同值有什么区别
- javascript - 使用 MEAN 堆栈中的字段更新数据
- jspdf - Html2Canvas 未在 iOS 中呈现 Font Awsome 图标
- node.js - 自定义电子邮件操作处理程序中的 handleResetPassword
- ios - NSNetserviceBrowser 委托方法未触发
- gcc - ARM 汇编程序的奇怪 GCC 行为。ANDSEQ 指令
- eclipse - Jersery @FormDataParam 和 FormDataContentDisposition 即使在添加 Maven 依赖项后也无法正常工作
- python - 如何引用外键链接表
- selenium - 如何绕过 Google 安全检查访问我自己的 Gmail 帐户