栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Spring Security-记住我身份验证错误

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Spring Security-记住我身份验证错误

这是由在SecurityContextPersistenceFilter之后使用FilterChainProxy引起的。特别是FilterChainProxy的HttpFirewall正在用不再实现SavedRequest的DefaultHttpFirewall替换HttpServletResponse。要解决此问题,可以将自定义HttpFirewall注入samlFilter
FilterChainProxy中,该返回返回传递给它的相同HttpServletResponse。例如:

public class DonothingHttpFirewall implements HttpFirewall {    public FirewalledRequest getFirewalledRequest(HttpServletRequest request) throws RequestRejectedException {        return new MyFirewalledRequest(request);    }    public HttpServletResponse getFirewalledResponse(HttpServletResponse response) {        return response;    }    private static class MyFirewalledRequest extends FirewalledRequest {         MyFirewalledRequest(HttpServletRequest r) {  super(r);         }         public void reset() {}    }}

然后,您可以使用以下方法进行接线:

<bean id="samlFilter" >  <security:filter-chain-map request-matcher="ant">    <security:filter-chain pattern="/saml/login/**" filters="samlEntryPoint"/>    <security:filter-chain pattern="/saml/SSO/**" filters="samlWebSSOProcessingFilter"/>  </security:filter-chain-map>  <property name="firewall">    <bean />  </property></bean>

我已经记录了一张票,可以在以后https://jira.spring.io/browse/SEC-2578透明地进行这项工作。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/452164.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号