spring security放行无效
时间: 2023-08-21 20:02:32 浏览: 145
根据提供的引用内容,spring security放行无效的原因可能是由于SpringMVC和SpringSecurity之间的映射冲突所致。引用中提到,可能是因为static文件夹被SpringMVC锁定了,导致无法访问。此外,引用中的SecurityConfig类也给出了一个配置,使用`securityCustomizer`方法来配置某些通用事物,其中包括忽略对`/static/**`路径的拦截。这可能是为了解决静态资源访问问题的一种解决方案。
因此,解决spring security放行无效的问题,可以考虑以下几个步骤:
1. 检查SpringMVC和SpringSecurity之间的映射冲突。确保两者的配置不会相互影响。
2. 确保static文件夹的权限设置正确,并且没有被其他组件所锁定。
3. 检查SecurityConfig类中的配置是否正确。特别是`securityCustomizer`方法中的配置是否包含了对`/static/**`路径的忽略,以及`filterChain`方法中对其他路径的授权设置是否正确。
4. 可以尝试重新启动应用程序,以确保配置的更改生效。
通过检查以上步骤,应该能够解决spring security放行无效的问题,并且使static文件夹能够被正确访问。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [【SpringSecurity】SpringSecurity版本5.7.4静态资源放行失败解决,SpringBoot版本2.7.5](https://blog.csdn.net/nifengdeshuye/article/details/127955586)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)