引入SpringSecurity后显示localhost 拒绝了我们的连接请求
引入SpringSecurity后显示localhost 拒绝了我们的连接请求,找了很多资料不知道如何解决,在过程中也修改了SpringSecurity防火墙配置,无果。
仔细探究后,找到解决办法:
在SrpingSecurity配置类中找到protected void configure(HttpSecurity http) throws Exception方法,添加
http.csrf().disable();
.headers().frameOptions().disable();//允许iframe页面嵌套
本文介绍了解决SpringSecurity配置后本地localhost拒绝连接问题的方法,重点在于在`HttpSecurity`配置中添加`csrf().disable()`和`.headers().frameOptions().disable()`,以允许跨站请求和iframe嵌套功能。
9289

被折叠的 条评论
为什么被折叠?



