Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在spring oauth2客户端中处理令牌响应_Spring_Oauth_Spring Cloud_Spring Webflux_Spring Cloud Gateway - Fatal编程技术网

在spring oauth2客户端中处理令牌响应

在spring oauth2客户端中处理令牌响应,spring,oauth,spring-cloud,spring-webflux,spring-cloud-gateway,Spring,Oauth,Spring Cloud,Spring Webflux,Spring Cloud Gateway,我使用SpringCloudGateway作为我们系统的API网关。我们希望将所有身份验证(oauth)委托给该组件。我在看SpringOAuth2客户端的源代码,但我看不到任何地方可以“插入”来完成我需要的工作 我想抓住代码交换成功的时刻,在cookie或query param中使用id\u token和refresh\u token进行重定向。我们也不存储任何会话-整个身份验证是无状态的 我正在如下配置安全WebFilterChain(WebFlux安全): @Bean public S

我使用SpringCloudGateway作为我们系统的API网关。我们希望将所有身份验证(oauth)委托给该组件。我在看SpringOAuth2客户端的源代码,但我看不到任何地方可以“插入”来完成我需要的工作

我想抓住代码交换成功的时刻,在cookie或query param中使用
id\u token
refresh\u token
进行重定向。我们也不存储任何会话-整个身份验证是无状态的

我正在如下配置
安全WebFilterChain
(WebFlux安全):

@Bean
  public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
  http
      .authorizeExchange(Customizer.withDefaults())
      .oauth2Login();
    http.csrf().disable();
    return http.build();
  }
我尝试使用successHandler
.oauth2Login(c->c.authenticationSuccessHandler(successHandler)),但在那一刻,我无法访问刷新令牌(只有WebFilterExchange、参数中的身份验证),而且我甚至不确定应该如何在该位置执行重定向表单

有没有办法做到这一点