Java 使用WebFlux和OAuth2(oauth2Login)为Spring Security定制登录页面
在启用了Java 使用WebFlux和OAuth2(oauth2Login)为Spring Security定制登录页面,java,spring-security,spring-security-oauth2,spring-webflux,Java,Spring Security,Spring Security Oauth2,Spring Webflux,在启用了WebFlux应用程序和OAuth2的Spring Security 5.1.4上,我找不到任何方法来覆盖为/login生成的默认登录页面。我只是简单地为/login创建了一个控制器,但是没有点击该控制器 到目前为止,我找到的唯一“解决方案”是设置httpSecurity.exceptionHandling().authenticationEntryPoint(…) 令我惊讶的是,登录控制器开始工作,因为这阻止了LoginPageSpec生成LoginPageGeneratingWebF
WebFlux应用程序和OAuth2的Spring Security 5.1.4
上,我找不到任何方法来覆盖为/login
生成的默认登录页面。我只是简单地为/login
创建了一个控制器,但是没有点击该控制器
到目前为止,我找到的唯一“解决方案”是设置httpSecurity.exceptionHandling().authenticationEntryPoint(…)
令我惊讶的是,登录控制器开始工作,因为这阻止了LoginPageSpec
生成LoginPageGeneratingWebFilter
在这样的设置中,是否有用于覆盖登录页面的工具
var httpSecurity =
http.authorizeExchange()
.anyExchange()
.authenticated()
.and()
.oauth2Login()
.authenticationConverter(tokenConverter)
.and()
.logout()
.logoutHandler(new KeycloakLogoutHandler(serverOAuth2AuthorizedClientRepository()))
.logoutSuccessHandler(logoutSuccessHandler)
.logoutUrl("/sso/logout")
.and()
.csrf()
.disable()
.authenticationEntryPoint(new RedirectServerAuthenticationEntryPoint("/login"))
.and()
.build();