在Spring Boot Gateway

问题描述 投票:0回答:1
client(浏览器) - >春季启动网关Throgh ngrok(

Https://dfsdfs-sds-prawn.ngrok-free.app-> http:// localHost:8080) - > spring webflux app(https:// localhost:433) Spring WebFlux应用程序具有一个控制器,在该控制器中执行本地重定向:

@PostMapping("login-initiation") Mono<RedirectView> loginInitiation(ServerWebExchange exchange, WebSession webSession) { ... return clientRegistrationEntityService.findByClientId(loginInitiationRequest.clientId()) .map(clientRegistration -> new RedirectView("/oauth2/authorization/" + clientRegistration.getRegistrationId())); });

我期望绝对重定向路径是 https:// localhost:443/oauth2/授权/,

但相反,实际的重定向路径是
https://dfsdfs-sds-prawn.ngrok-free.app/oauth2/authorization/

.uth..

使用网关域而不是本地主机的原因是什么? 我如何确保重定向路径为https:// localhost:443/oauth2/授权/

trory设置一个绝对URL:

@PostMapping("login-initiation") Mono<RedirectView> loginInitiation(ServerWebExchange exchange, WebSession webSession) { ... return clientRegistrationEntityService.findByClientId(loginInitiationRequest.clientId()) .map(clientRegistration -> new RedirectView("https://localhost:433/oauth2/authorization/" + clientRegistration.getRegistrationId())); });
spring-boot http-redirect spring-webflux gateway ngrok
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.