![](/img/trans.png)
[英]SpringBoot - Error parsing HTTP request header (Oauth2 https endpoints)
[英]SpringBoot oAuth2 Location Header
我有三個微服務
所有請求都發送到端口 8080 上的網關服務,將它們重定向到特定服務
@Bean
public RouteLocator myRoutes (
RouteLocatorBuilder builder
) {
return builder.routes()
.route(p -> p.path("/auth/**")
.filters(f -> f.rewritePath("^/auth", ""))
.uri(authServiceUri))
.route(p -> p
.path("/payments/**")
.filters(f -> f.rewritePath("^/payments", ""))
.uri(paymentServiceUri)
)
.route(p -> p
.path("/insurance/**")
.filters(f -> f.rewritePath("^/insurance", ""))
.uri(insuranceServiceUri)
)
.build();
}
如果我導航到 /insurance oAuth 將我重定向到登錄頁面(api.domain.com/auth/login),然后使用用戶憑據(api.domain.com/auth/login)的登錄表單發出 POST 請求,此請求(如果成功)包含一個 Location Header,它將用戶重定向到 /oauth/authorize 端點。
The problem is that this header does not contain the gateway service URL (api.domain.com:8080/auth) but it contains the direct service url (http://localhost:9999) how can i fix this? 如何告訴 Spring oAuth 將重定向發送回網關服務器而不是服務 url?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.