what would be a recommended way of configuring Spring Cloud Gateway that routes Spring Authorization Server with hostname route without colliding paths.
for example:
When accessing http://dummy.traefik.me/login does not go through the security filter chain, if so, I think it can be done like this
private ServerWebExchangeMatcher getSecurityMatcher() {
return exchange -> {
URI uri = exchange.getRequest().getURI();
if (uri.getHost().equals("dummy.traefik.me")) {
return ServerWebExchangeMatcher.MatchResult.notMatch();
}
return ServerWebExchangeMatcher.MatchResult.match();
};
}
@Bean
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
http
.securityMatcher(getSecurityMatcher())
.authorizeExchange(authorizeRequests -> authorizeRequests
.anyExchange()
.authenticated()
)
.formLogin(withDefaults())
.logout(withDefaults());
return http.build();
}