diff --git a/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_0.svg b/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_0.svg index 1f9ab52..fd59561 100755 --- a/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_0.svg +++ b/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_0.svg @@ -1,198 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_1.svg b/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_1.svg index 7a118f3..508aa1e 100755 --- a/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_1.svg +++ b/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_1.svg @@ -1,9387 +1 @@ - - - -image/svg+xml \ No newline at end of file + \ No newline at end of file diff --git a/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_2.svg b/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_2.svg index 1747933..69f3f43 100755 --- a/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_2.svg +++ b/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_2.svg @@ -1,841 +1 @@ - - - -image/svg+xml \ No newline at end of file + \ No newline at end of file diff --git a/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_3.svg b/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_3.svg index 6b9e056..fbbe8f7 100755 --- a/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_3.svg +++ b/jhipster/gateway/src/main/webapp/content/images/jhipster_family_member_3.svg @@ -1,308 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/jhipster/gateway/src/main/webapp/swagger-ui/dist/images/throbber.gif b/jhipster/gateway/src/main/webapp/swagger-ui/dist/images/throbber.gif index 0639388..0a55cf0 100644 Binary files a/jhipster/gateway/src/main/webapp/swagger-ui/dist/images/throbber.gif and b/jhipster/gateway/src/main/webapp/swagger-ui/dist/images/throbber.gif differ diff --git a/spring-cloud-gateway/api-gateway/src/main/java/com/example/apigateway/ApiGatewayApplication.java b/spring-cloud-gateway/api-gateway/src/main/java/com/example/apigateway/ApiGatewayApplication.java index 5ee2d2d..1060f86 100755 --- a/spring-cloud-gateway/api-gateway/src/main/java/com/example/apigateway/ApiGatewayApplication.java +++ b/spring-cloud-gateway/api-gateway/src/main/java/com/example/apigateway/ApiGatewayApplication.java @@ -9,6 +9,8 @@ import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.security.oauth2.gateway.TokenRelayGatewayFilterFactory; import org.springframework.context.annotation.Bean; +import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; +import org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.reactive.function.client.WebClient; @@ -59,8 +61,9 @@ public FaveCarsController(WebClient.Builder carClient) { } @GetMapping("/fave-cars") - public Flux faveCars() { + public Flux faveCars(@RegisteredOAuth2AuthorizedClient("okta") OAuth2AuthorizedClient authorizedClient) { return carClient.build().get().uri("lb://car-service/cars") + .header("Authorization", "Bearer " + authorizedClient.getAccessToken().getTokenValue()) .retrieve().bodyToFlux(Car.class) .filter(this::isFavorite); } diff --git a/spring-cloud-gateway/api-gateway/src/main/java/com/example/apigateway/SecurityConfiguration.java b/spring-cloud-gateway/api-gateway/src/main/java/com/example/apigateway/SecurityConfiguration.java index 56c37b6..adb18c1 100644 --- a/spring-cloud-gateway/api-gateway/src/main/java/com/example/apigateway/SecurityConfiguration.java +++ b/spring-cloud-gateway/api-gateway/src/main/java/com/example/apigateway/SecurityConfiguration.java @@ -6,7 +6,7 @@ import org.springframework.security.config.web.server.ServerHttpSecurity; import org.springframework.security.web.server.SecurityWebFilterChain; import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.reactive.CorsWebFilter; +import org.springframework.web.cors.reactive.CorsConfigurationSource; import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource; import java.util.List; @@ -31,7 +31,7 @@ public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) { } @Bean - CorsWebFilter corsWebFilter() { + CorsConfigurationSource corsConfigurationSource() { CorsConfiguration corsConfig = new CorsConfiguration(); corsConfig.setAllowedOrigins(List.of("*")); corsConfig.setMaxAge(3600L); @@ -40,7 +40,6 @@ CorsWebFilter corsWebFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", corsConfig); - - return new CorsWebFilter(source); + return source; } }