Kotlin Spring Webflux安全资源服务器多租户-按REST路径颁发者
我正在使用Webflux安全性实现多租户资源服务器 这是我当前的配置:Kotlin Spring Webflux安全资源服务器多租户-按REST路径颁发者,kotlin,spring-security,spring-webflux,spring-security-oauth2,Kotlin,Spring Security,Spring Webflux,Spring Security Oauth2,我正在使用Webflux安全性实现多租户资源服务器 这是我当前的配置: @Bean fun securityConfig(http: ServerHttpSecurity): SecurityWebFilterChain? { http.authorizeExchange() .pathMatchers("/path1", "/path2").authenticated() .
@Bean
fun securityConfig(http: ServerHttpSecurity): SecurityWebFilterChain? {
http.authorizeExchange()
.pathMatchers("/path1", "/path2").authenticated()
.and()
.oauth2ResourceServer { rs ->
rs.authenticationManagerResolver(
JwtIssuerReactiveAuthenticationManagerResolver(
"http://localhost:8081/auth/realms/realm1",
"http://localhost:8082/auth/realms/realm2"
)
)
}
return http.build()
}
这是有效的,我有/path1和/path2由受信任的发行人1或受信任的发行人2保护。这允许我使用oauth2发行者调用path1,但这不是我想要的
我需要有/path1仅由信任发行人1担保,而/path2仅由信任发行人2担保,我不确定如何实现,有什么提示吗
谢谢 通过设置两个单独的安全配置?通过设置@Order(1)和@Order(2)尝试了这一点,但只有第一个被应用,所以您声称spring安全性被破坏了?或者设置此设置的文档有缺陷?因为我希望您已经阅读了完整的文档