Pra*_*ant 8 spring-security kotlin spring-boot-admin
我试图为我的应用程序启用 Spring Boot 管理服务器。默认设置工作得很好,但是当我尝试启用安全性时,出现以下错误:
应用程序无法启动
描述:
无法注册在类路径资源 [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class] 中定义的 bean 'conversionServicePostProcessor'。具有该名称的 bean 已经在类路径资源 [org/springframework/security/config/annotation/web/reactive/WebFluxSecurityConfiguration.class] 中定义并且覆盖被禁用。
行动:
考虑通过设置 spring.main.allow-bean-definition-overriding=true 重命名其中一个 bean 或启用覆盖
进程以退出代码 1 结束
我正在使用spring-boot-admin-starter-server(2.2.0-SNAPSHOT)的最新 SNAPSHOT 版本。这是我的安全配置:
@EnableAdminServer
@EnableWebFluxSecurity
@Configuration(proxyBeanMethods = false)
class AdminServerSecurityConfigurations(val adminServerProperties: AdminServerProperties) {
@Bean
fun adminServerSecurityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain = http
// @formatter:off
.authorizeExchange()
.pathMatchers("${adminServerProperties.contextPath}/assets/**").permitAll()
.pathMatchers("${adminServerProperties.contextPath}/login").permitAll()
.anyExchange().authenticated().and()
.formLogin().loginPage("${adminServerProperties.contextPath}/login").and()
.logout().logoutUrl("${adminServerProperties.contextPath}/logout").and()
.httpBasic().and()
// @formatter:on
.csrf().disable()
.build()
@Bean
fun notifyLogger(instanceRepository: InstanceRepository) = LoggingNotifier(instanceRepository)
}
Run Code Online (Sandbox Code Playgroud)
小智 6
我发现了更新文档的拉取请求:https://github.com/spring-projects/spring-boot/issues/14069
对于 Reactive WebSockets,{spring-reference}web-reactive.html#webflux-websocket[Spring WebFlux] 提供了丰富的支持,可以通过该
spring-boot-starter-webflux模块访问。请参阅spring-boot-sample-websocket-reactive示例项目以了解如何使用 Spring WebFlux 实现 WebSocket。
事实证明,使用 webflux 和 websocket 会导致冲突。
在此拉取请求中,冲突的解决也被拒绝 https://github.com/spring-projects/spring-boot/issues/14810
对于反应式 websocket,请参阅此示例https://www.baeldung.com/spring-5-reactive-websockets
| 归档时间: |
|
| 查看次数: |
4574 次 |
| 最近记录: |