ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry = httpSecurity
.authorizeRequests();
//这里表示不需要权限校验
ignoreUrlsProperties.getUrls().forEach(url -> registry.antMatchers(url).permitAll());
httpSecurity
// 由于使用的是JWT,我们这里不需要csrf
.csrf().disable()
.headers().frameOptions().disable()
.and()
.exceptionHandling()
.authenticationEntryPoint(unauthorizedHandler)
.accessDeniedHandler(customerRestAccessDeniedHandler).and()
Springboot 项目 frame-options deny禁止iframe调用
最新推荐文章于 2024-06-25 22:12:59 发布
该博客介绍了如何在Springboot项目中通过ExpressionUrlAuthorizationConfigurer配置HTTP安全,特别是使用headers().frameOptions().deny()来禁止iframe加载页面,以增强应用的安全性。同时,文章提到了忽略特定URL的权限校验,并且在CSRF保护方面选择了disable。
摘要由CSDN通过智能技术生成