【发布时间】:2022-01-14 06:36:30
【问题描述】:
我正在使用以下依赖项
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
我为端点 /login 启用了 oauth2,现在当我在成功验证后访问 URL /login?foo=bar 时,我被重定向到路径 /。我知道我可以使用ServerAuthenticationSuccessHandler.setLocation() 方法设置重定向网址,但我希望能够使用查询参数foo 及其值bar 重定向到页面success.html,类似于/success.html?foo=bar,我该如何检索在身份验证之前最初向登录端点发出的请求?
【问题讨论】:
标签: spring spring-boot spring-webflux