【发布时间】:2021-08-15 15:02:08
【问题描述】:
在我目前的系统中, 我们正在为下面提到的 Spring 安全网关使用以下功能。
http
.csrf().disable()
.exceptionHandling().and()
.httpBasic().disable()
但现在我想构建一个新的端点,它将使用 HttpBasic 安全性,那么如何使用 PathMatcher 管理这些东西?
如果我们想为 httpBasic disable 或 httpBasic enable 使用不同的配置方法。 那么它对我有什么作用呢?
当我将在同一个类中使用两个过滤器时,我将得到以下错误..
说明:
无法注册在类路径资源 [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class] 中定义的 bean 'conversionServicePostProcessor'。已在类路径资源 [org/springframework/security/config/annotation/web/reactive/WebFluxSecurityConfiguration.class] 中定义了具有该名称的 bean,并且已禁用覆盖。
行动:
考虑重命名其中一个 bean 或通过设置 spring.main.allow-bean-definition-overriding=true 来启用覆盖
【问题讨论】:
-
@Alex 我说的是 PathMatcher..
标签: java spring-boot spring-security