PacktPublishing / Microservices-with-Spring-Boot-and-Spring-Cloud-2E

Microservices-with-Spring-Boot-and-Spring-Cloud-2E, Published by Packt
MIT License
236 stars 261 forks source link

Swagger Auth-Server Config. #12

Open ahmedAbouismail opened 2 years ago

ahmedAbouismail commented 2 years ago

After I click on the "Authorize" button, I end up on the login page. But after I enter the credentials, I get redirected to this error page https://localhost:8443/oauth2/authorize?response_type=code&client_id=writer&redirect_uri=https%3A%2F%2Flocalhost%3A8443%2Fopenapi%2Fwebjarshttps%3A%2Flocalhost%3A8443%2Fwebjars%2Fswagger-ui%2Foauth2-redirect.html&scope=chat%3Aread%20chat%3Awrite&state=U2F0IE1heSAyMSAyMDIyIDEyOjI4OjI2IEdNVCswMjAwIChDZW50cmFsIEV1cm9wZWFuIFN1bW1lciBUaW1lKQ%3D%3D

022-05-21 10:28:16.701 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/chat-composite/**]" does not match against value "/openapi/swagger-ui.html"
2022-05-21T10:28:16.701915000Z 2022-05-21 10:28:16.701 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/oauth2/**]" does not match against value "/openapi/swagger-ui.html"
2022-05-21T10:28:16.710477600Z 2022-05-21 10:28:16.710 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/login/**]" does not match against value "/openapi/swagger-ui.html"
2022-05-21T10:28:16.714731900Z 2022-05-21 10:28:16.711 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/error/**]" does not match against value "/openapi/swagger-ui.html"
2022-05-21T10:28:16.721042000Z 2022-05-21 10:28:16.715 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "/openapi/**" matches against value "/openapi/swagger-ui.html"
2022-05-21T10:28:16.721085600Z 2022-05-21 10:28:16.716 DEBUG 1 --- [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : Route matched: chat-composite-swagger-ui
2022-05-21T10:28:16.721094700Z 2022-05-21 10:28:16.717 DEBUG 1 --- [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : Mapping [Exchange: GET https://localhost:8443/openapi/swagger-ui.html] to Route{id='chat-composite-swagger-ui', uri=lb://chat-composite, order=0, predicate=Paths: [/openapi/**], match trailing slash: true, gatewayFilters=[], metadata={}}
2022-05-21T10:28:16.721101300Z 2022-05-21 10:28:16.717 DEBUG 1 --- [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : [939ee057-1] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@183ff136
2022-05-21T10:28:16.721108100Z 2022-05-21 10:28:16.718 DEBUG 1 --- [     parallel-1] o.s.c.g.handler.FilteringWebHandler      : Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@2673487b}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@6e948f1c}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@3de56885}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@194224ca}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@350f18a6}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@2d07aacc}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@2fb48970}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@254e9709}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@4e8d9bb6}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@ff5d4f1}, order = 2147483647]]
2022-05-21T10:28:16.729719200Z 2022-05-21 10:28:16.729 TRACE 1 --- [     parallel-1] o.s.c.g.filter.RouteToRequestUrlFilter   : RouteToRequestUrlFilter start
2022-05-21T10:28:16.731375600Z 2022-05-21 10:28:16.731 TRACE 1 --- [     parallel-1] s.c.g.f.ReactiveLoadBalancerClientFilter : ReactiveLoadBalancerClientFilter url before: lb://chat-composite/openapi/swagger-ui.html
2022-05-21T10:28:16.971369400Z 2022-05-21 10:28:16.971 TRACE 1 --- [     parallel-1] s.c.g.f.ReactiveLoadBalancerClientFilter : LoadBalancerClientFilter url chosen: http://64885baa833a:8080/openapi/swagger-ui.html
2022-05-21T10:28:17.325812600Z 2022-05-21 10:28:17.325 TRACE 1 --- [or-http-epoll-2] o.s.c.gateway.filter.NettyRoutingFilter  : outbound route: a70962ea, inbound: [939ee057-1] 
2022-05-21T10:28:17.426821100Z 2022-05-21 10:28:17.425 TRACE 1 --- [or-http-epoll-2] o.s.c.g.filter.NettyWriteResponseFilter  : NettyWriteResponseFilter start inbound: a70962ea, outbound: [939ee057-1] 
2022-05-21T10:28:17.477673700Z 2022-05-21 10:28:17.473 TRACE 1 --- [or-http-epoll-2] o.s.c.g.filter.GatewayMetricsFilter      : spring.cloud.gateway.requests tags: [tag(httpMethod=GET),tag(httpStatusCode=302),tag(outcome=REDIRECTION),tag(routeId=chat-composite-swagger-ui),tag(routeUri=lb://chat-composite),tag(status=FOUND)]
2022-05-21T10:28:17.493618900Z 2022-05-21 10:28:17.493 TRACE 1 --- [or-http-epoll-4] o.s.w.s.adapter.HttpWebHandlerAdapter    : [939ee057-1] Completed 302 FOUND, headers={masked}
2022-05-21T10:28:17.507203200Z 2022-05-21 10:28:17.498 TRACE 1 --- [or-http-epoll-4] o.s.w.s.adapter.HttpWebHandlerAdapter    : [939ee057-2] HTTP GET "/openapi/webjars/swagger-ui/index.html?configUrl=/openapi/v3/api-docs/swagger-config", headers={masked}
2022-05-21T10:28:17.537971600Z 2022-05-21 10:28:17.537 TRACE 1 --- [     parallel-3] o.s.c.g.f.WeightCalculatorWebFilter      : Weights attr: {}
2022-05-21T10:28:17.541323600Z 2022-05-21 10:28:17.540 TRACE 1 --- [     parallel-3] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/chat-composite/**]" does not match against value "/openapi/webjars/swagger-ui/index.html"
2022-05-21T10:28:17.541510200Z 2022-05-21 10:28:17.541 TRACE 1 --- [     parallel-3] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/oauth2/**]" does not match against value "/openapi/webjars/swagger-ui/index.html"
2022-05-21T10:28:17.541775000Z 2022-05-21 10:28:17.541 TRACE 1 --- [     parallel-3] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/login/**]" does not match against value "/openapi/webjars/swagger-ui/index.html"
2022-05-21T10:28:17.543101600Z 2022-05-21 10:28:17.541 TRACE 1 --- [     parallel-3] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/error/**]" does not match against value "/openapi/webjars/swagger-ui/index.html"
2022-05-21T10:28:17.555071100Z 2022-05-21 10:28:17.544 TRACE 1 --- [     parallel-3] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "/openapi/**" matches against value "/openapi/webjars/swagger-ui/index.html"
2022-05-21T10:28:17.555126700Z 2022-05-21 10:28:17.544 DEBUG 1 --- [     parallel-3] o.s.c.g.h.RoutePredicateHandlerMapping   : Route matched: chat-composite-swagger-ui
2022-05-21T10:28:17.555150800Z 2022-05-21 10:28:17.545 DEBUG 1 --- [     parallel-3] o.s.c.g.h.RoutePredicateHandlerMapping   : Mapping [Exchange: GET https://localhost:8443/openapi/webjars/swagger-ui/index.html?configUrl=/openapi/v3/api-docs/swagger-config] to Route{id='chat-composite-swagger-ui', uri=lb://chat-composite, order=0, predicate=Paths: [/openapi/**], match trailing slash: true, gatewayFilters=[], metadata={}}
2022-05-21T10:28:17.555158200Z 2022-05-21 10:28:17.545 DEBUG 1 --- [     parallel-3] o.s.c.g.h.RoutePredicateHandlerMapping   : [939ee057-2] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@183ff136
2022-05-21T10:28:17.555165400Z 2022-05-21 10:28:17.547 DEBUG 1 --- [     parallel-3] o.s.c.g.handler.FilteringWebHandler      : Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@2673487b}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@6e948f1c}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@3de56885}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@194224ca}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@350f18a6}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@2d07aacc}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@2fb48970}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@254e9709}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@4e8d9bb6}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@ff5d4f1}, order = 2147483647]]
2022-05-21T10:28:17.555175000Z 2022-05-21 10:28:17.547 TRACE 1 --- [     parallel-3] o.s.c.g.filter.RouteToRequestUrlFilter   : RouteToRequestUrlFilter start
2022-05-21T10:28:17.555180700Z 2022-05-21 10:28:17.548 TRACE 1 --- [     parallel-3] s.c.g.f.ReactiveLoadBalancerClientFilter : ReactiveLoadBalancerClientFilter url before: lb://chat-composite/openapi/webjars/swagger-ui/index.html?configUrl=/openapi/v3/api-docs/swagger-config
2022-05-21T10:28:17.556884300Z 2022-05-21 10:28:17.556 TRACE 1 --- [     parallel-3] s.c.g.f.ReactiveLoadBalancerClientFilter : LoadBalancerClientFilter url chosen: http://64885baa833a:8080/openapi/webjars/swagger-ui/index.html?configUrl=/openapi/v3/api-docs/swagger-config
2022-05-21T10:28:17.559963500Z 2022-05-21 10:28:17.559 TRACE 1 --- [or-http-epoll-2] o.s.c.gateway.filter.NettyRoutingFilter  : outbound route: a70962ea, inbound: [939ee057-2] 
2022-05-21T10:28:17.579046000Z 2022-05-21 10:28:17.577 TRACE 1 --- [or-http-epoll-2] o.s.c.g.filter.NettyWriteResponseFilter  : NettyWriteResponseFilter start inbound: a70962ea, outbound: [939ee057-2] 
2022-05-21T10:28:17.596260500Z 2022-05-21 10:28:17.595 TRACE 1 --- [or-http-epoll-2] o.s.c.g.filter.GatewayMetricsFilter      : spring.cloud.gateway.requests tags: [tag(httpMethod=GET),tag(httpStatusCode=200),tag(outcome=SUCCESSFUL),tag(routeId=chat-composite-swagger-ui),tag(routeUri=lb://chat-composite),tag(status=OK)]
2022-05-21T10:28:17.610945500Z 2022-05-21 10:28:17.601 TRACE 1 --- [or-http-epoll-4] o.s.w.s.adapter.HttpWebHandlerAdapter    : [939ee057-2] Completed 200 OK, headers={masked}
2022-05-21T10:28:17.697004300Z 2022-05-21 10:28:17.696 TRACE 1 --- [or-http-epoll-4] o.s.w.s.adapter.HttpWebHandlerAdapter    : [939ee057-3] HTTP GET "/openapi/webjars/swagger-ui/swagger-ui.css", headers={masked}
2022-05-21T10:28:17.761926100Z 2022-05-21 10:28:17.739 TRACE 1 --- [     parallel-4] o.s.c.g.f.WeightCalculatorWebFilter      : Weights attr: {}
2022-05-21T10:28:17.761989300Z 2022-05-21 10:28:17.756 TRACE 1 --- [     parallel-4] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/chat-composite/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui.css"
2022-05-21T10:28:17.762001100Z 2022-05-21 10:28:17.758 TRACE 1 --- [     parallel-4] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/oauth2/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui.css"
2022-05-21T10:28:17.762008000Z 2022-05-21 10:28:17.759 TRACE 1 --- [     parallel-4] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/login/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui.css"
2022-05-21T10:28:17.806090700Z 2022-05-21 10:28:17.803 TRACE 1 --- [     parallel-4] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/error/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui.css"
2022-05-21T10:28:17.806139700Z 2022-05-21 10:28:17.804 TRACE 1 --- [     parallel-4] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "/openapi/**" matches against value "/openapi/webjars/swagger-ui/swagger-ui.css"
2022-05-21T10:28:17.806152900Z 2022-05-21 10:28:17.805 DEBUG 1 --- [     parallel-4] o.s.c.g.h.RoutePredicateHandlerMapping   : Route matched: chat-composite-swagger-ui
2022-05-21T10:28:17.806303600Z 2022-05-21 10:28:17.805 DEBUG 1 --- [     parallel-4] o.s.c.g.h.RoutePredicateHandlerMapping   : Mapping [Exchange: GET https://localhost:8443/openapi/webjars/swagger-ui/swagger-ui.css] to Route{id='chat-composite-swagger-ui', uri=lb://chat-composite, order=0, predicate=Paths: [/openapi/**], match trailing slash: true, gatewayFilters=[], metadata={}}
2022-05-21T10:28:17.806316000Z 2022-05-21 10:28:17.805 DEBUG 1 --- [     parallel-4] o.s.c.g.h.RoutePredicateHandlerMapping   : [939ee057-3] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@183ff136
2022-05-21T10:28:17.806325300Z 2022-05-21 10:28:17.805 DEBUG 1 --- [     parallel-4] o.s.c.g.handler.FilteringWebHandler      : Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@2673487b}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@6e948f1c}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@3de56885}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@194224ca}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@350f18a6}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@2d07aacc}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@2fb48970}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@254e9709}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@4e8d9bb6}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@ff5d4f1}, order = 2147483647]]
2022-05-21T10:28:17.807729200Z 2022-05-21 10:28:17.806 TRACE 1 --- [     parallel-4] o.s.c.g.filter.RouteToRequestUrlFilter   : RouteToRequestUrlFilter start
2022-05-21T10:28:17.892218000Z 2022-05-21 10:28:17.850 TRACE 1 --- [     parallel-4] s.c.g.f.ReactiveLoadBalancerClientFilter : ReactiveLoadBalancerClientFilter url before: lb://chat-composite/openapi/webjars/swagger-ui/swagger-ui.css
2022-05-21T10:28:17.892274500Z 2022-05-21 10:28:17.851 TRACE 1 --- [     parallel-4] s.c.g.f.ReactiveLoadBalancerClientFilter : LoadBalancerClientFilter url chosen: http://64885baa833a:8080/openapi/webjars/swagger-ui/swagger-ui.css
2022-05-21T10:28:17.892286300Z 2022-05-21 10:28:17.854 TRACE 1 --- [or-http-epoll-2] o.s.c.gateway.filter.NettyRoutingFilter  : outbound route: a70962ea, inbound: [939ee057-3] 
2022-05-21T10:28:18.424297700Z 2022-05-21 10:28:18.416 TRACE 1 --- [or-http-epoll-2] o.s.c.g.filter.NettyWriteResponseFilter  : NettyWriteResponseFilter start inbound: a70962ea, outbound: [939ee057-3] 
2022-05-21T10:28:18.483977400Z 2022-05-21 10:28:18.475 TRACE 1 --- [or-http-epoll-2] o.s.c.g.filter.GatewayMetricsFilter      : spring.cloud.gateway.requests tags: [tag(httpMethod=GET),tag(httpStatusCode=200),tag(outcome=SUCCESSFUL),tag(routeId=chat-composite-swagger-ui),tag(routeUri=lb://chat-composite),tag(status=OK)]
2022-05-21T10:28:18.731743800Z 2022-05-21 10:28:18.731 TRACE 1 --- [or-http-epoll-1] o.s.w.s.adapter.HttpWebHandlerAdapter    : [c4b942d2-1] HTTP GET "/openapi/webjars/swagger-ui/swagger-ui-bundle.js", headers={masked}
2022-05-21T10:28:18.749989700Z 2022-05-21 10:28:18.749 TRACE 1 --- [     parallel-1] o.s.c.g.f.WeightCalculatorWebFilter      : Weights attr: {}
2022-05-21T10:28:18.779631900Z 2022-05-21 10:28:18.766 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/chat-composite/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui-bundle.js"
2022-05-21T10:28:18.789322600Z 2022-05-21 10:28:18.788 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/oauth2/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui-bundle.js"
2022-05-21T10:28:18.790292100Z 2022-05-21 10:28:18.789 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/login/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui-bundle.js"
2022-05-21T10:28:18.802610300Z 2022-05-21 10:28:18.790 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/error/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui-bundle.js"
2022-05-21T10:28:18.830900800Z 2022-05-21 10:28:18.829 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "/openapi/**" matches against value "/openapi/webjars/swagger-ui/swagger-ui-bundle.js"
2022-05-21T10:28:18.830964700Z 2022-05-21 10:28:18.830 DEBUG 1 --- [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : Route matched: chat-composite-swagger-ui
2022-05-21T10:28:18.830976200Z 2022-05-21 10:28:18.830 DEBUG 1 --- [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : Mapping [Exchange: GET https://localhost:8443/openapi/webjars/swagger-ui/swagger-ui-bundle.js] to Route{id='chat-composite-swagger-ui', uri=lb://chat-composite, order=0, predicate=Paths: [/openapi/**], match trailing slash: true, gatewayFilters=[], metadata={}}
2022-05-21T10:28:18.830983000Z 2022-05-21 10:28:18.830 DEBUG 1 --- [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : [c4b942d2-1] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@183ff136
2022-05-21T10:28:18.844242900Z 2022-05-21 10:28:18.841 DEBUG 1 --- [     parallel-1] o.s.c.g.handler.FilteringWebHandler      : Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@2673487b}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@6e948f1c}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@3de56885}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@194224ca}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@350f18a6}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@2d07aacc}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@2fb48970}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@254e9709}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@4e8d9bb6}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@ff5d4f1}, order = 2147483647]]
2022-05-21T10:28:18.844285700Z 2022-05-21 10:28:18.843 TRACE 1 --- [     parallel-1] o.s.c.g.filter.RouteToRequestUrlFilter   : RouteToRequestUrlFilter start
2022-05-21T10:28:18.844294700Z 2022-05-21 10:28:18.843 TRACE 1 --- [     parallel-1] s.c.g.f.ReactiveLoadBalancerClientFilter : ReactiveLoadBalancerClientFilter url before: lb://chat-composite/openapi/webjars/swagger-ui/swagger-ui-bundle.js
2022-05-21T10:28:18.849858800Z 2022-05-21 10:28:18.847 TRACE 1 --- [     parallel-1] s.c.g.f.ReactiveLoadBalancerClientFilter : LoadBalancerClientFilter url chosen: http://64885baa833a:8080/openapi/webjars/swagger-ui/swagger-ui-bundle.js
2022-05-21T10:28:18.856031600Z 2022-05-21 10:28:18.855 TRACE 1 --- [or-http-epoll-2] o.s.w.s.adapter.HttpWebHandlerAdapter    : [2c452163-1] HTTP GET "/openapi/webjars/swagger-ui/swagger-ui-standalone-preset.js", headers={masked}
2022-05-21T10:28:18.859541700Z 2022-05-21 10:28:18.859 TRACE 1 --- [or-http-epoll-2] o.s.c.gateway.filter.NettyRoutingFilter  : outbound route: a70962ea, inbound: [c4b942d2-1] 
2022-05-21T10:28:18.871453400Z 2022-05-21 10:28:18.870 TRACE 1 --- [     parallel-2] o.s.c.g.f.WeightCalculatorWebFilter      : Weights attr: {}
2022-05-21T10:28:18.883839600Z 2022-05-21 10:28:18.873 TRACE 1 --- [     parallel-2] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/chat-composite/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui-standalone-preset.js"
2022-05-21T10:28:18.883908100Z 2022-05-21 10:28:18.874 TRACE 1 --- [     parallel-2] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/oauth2/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui-standalone-preset.js"
2022-05-21T10:28:18.883931700Z 2022-05-21 10:28:18.874 TRACE 1 --- [     parallel-2] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/login/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui-standalone-preset.js"
2022-05-21T10:28:18.904988500Z 2022-05-21 10:28:18.875 TRACE 1 --- [     parallel-2] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/error/**]" does not match against value "/openapi/webjars/swagger-ui/swagger-ui-standalone-preset.js"
2022-05-21T10:28:18.905059300Z 2022-05-21 10:28:18.877 TRACE 1 --- [     parallel-2] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "/openapi/**" matches against value "/openapi/webjars/swagger-ui/swagger-ui-standalone-preset.js"
2022-05-21T10:28:18.905249000Z 2022-05-21 10:28:18.877 DEBUG 1 --- [     parallel-2] o.s.c.g.h.RoutePredicateHandlerMapping   : Route matched: chat-composite-swagger-ui
2022-05-21T10:28:18.905272700Z 2022-05-21 10:28:18.878 DEBUG 1 --- [     parallel-2] o.s.c.g.h.RoutePredicateHandlerMapping   : Mapping [Exchange: GET https://localhost:8443/openapi/webjars/swagger-ui/swagger-ui-standalone-preset.js] to Route{id='chat-composite-swagger-ui', uri=lb://chat-composite, order=0, predicate=Paths: [/openapi/**], match trailing slash: true, gatewayFilters=[], metadata={}}
2022-05-21T10:28:18.905324500Z 2022-05-21 10:28:18.878 DEBUG 1 --- [     parallel-2] o.s.c.g.h.RoutePredicateHandlerMapping   : [2c452163-1] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@183ff136
2022-05-21T10:28:18.905351700Z 2022-05-21 10:28:18.878 DEBUG 1 --- [     parallel-2] o.s.c.g.handler.FilteringWebHandler      : Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@2673487b}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@6e948f1c}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@3de56885}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@194224ca}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@350f18a6}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@2d07aacc}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@2fb48970}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@254e9709}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@4e8d9bb6}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@ff5d4f1}, order = 2147483647]]
2022-05-21T10:28:18.905425000Z 2022-05-21 10:28:18.878 TRACE 1 --- [     parallel-2] o.s.c.g.filter.RouteToRequestUrlFilter   : RouteToRequestUrlFilter start
2022-05-21T10:28:18.905445800Z 2022-05-21 10:28:18.878 TRACE 1 --- [     parallel-2] s.c.g.f.ReactiveLoadBalancerClientFilter : ReactiveLoadBalancerClientFilter url before: lb://chat-composite/openapi/webjars/swagger-ui/swagger-ui-standalone-preset.js
2022-05-21T10:28:18.905493300Z 2022-05-21 10:28:18.879 TRACE 1 --- [     parallel-2] s.c.g.f.ReactiveLoadBalancerClientFilter : LoadBalancerClientFilter url chosen: http://64885baa833a:8080/openapi/webjars/swagger-ui/swagger-ui-standalone-preset.js
2022-05-21T10:28:18.905525000Z 2022-05-21 10:28:18.903 TRACE 1 --- [or-http-epoll-3] o.s.c.gateway.filter.NettyRoutingFilter  : outbound route: 61ed3201, inbound: [2c452163-1] 
2022-05-21T10:28:18.917916100Z 2022-05-21 10:28:18.913 TRACE 1 --- [or-http-epoll-4] o.s.w.s.adapter.HttpWebHandlerAdapter    : [939ee057-3] Completed 200 OK, headers={masked}
2022-05-21T10:28:18.968565300Z 2022-05-21 10:28:18.952 TRACE 1 --- [or-http-epoll-2] o.s.c.g.filter.NettyWriteResponseFilter  : NettyWriteResponseFilter start inbound: a70962ea, outbound: [c4b942d2-1] 
2022-05-21T10:28:18.968641900Z 2022-05-21 10:28:18.953 TRACE 1 --- [or-http-epoll-3] o.s.c.g.filter.NettyWriteResponseFilter  : NettyWriteResponseFilter start inbound: 61ed3201, outbound: [2c452163-1] 
2022-05-21T10:28:18.968665800Z 2022-05-21 10:28:18.953 TRACE 1 --- [or-http-epoll-2] o.s.c.g.filter.GatewayMetricsFilter      : spring.cloud.gateway.requests tags: [tag(httpMethod=GET),tag(httpStatusCode=200),tag(outcome=SUCCESSFUL),tag(routeId=chat-composite-swagger-ui),tag(routeUri=lb://chat-composite),tag(status=OK)]
2022-05-21T10:28:19.121934200Z 2022-05-21 10:28:19.027 TRACE 1 --- [or-http-epoll-3] o.s.c.g.filter.GatewayMetricsFilter      : spring.cloud.gateway.requests tags: [tag(httpMethod=GET),tag(httpStatusCode=200),tag(outcome=SUCCESSFUL),tag(routeId=chat-composite-swagger-ui),tag(routeUri=lb://chat-composite),tag(status=OK)]
2022-05-21T10:28:19.471719300Z 2022-05-21 10:28:19.471 TRACE 1 --- [or-http-epoll-2] o.s.w.s.adapter.HttpWebHandlerAdapter    : [2c452163-1] Completed 200 OK, headers={masked}
2022-05-21T10:28:19.887287500Z 2022-05-21 10:28:19.878 TRACE 1 --- [or-http-epoll-1] o.s.w.s.adapter.HttpWebHandlerAdapter    : [c4b942d2-1] Completed 200 OK, headers={masked}
2022-05-21T10:28:20.353473000Z 2022-05-21 10:28:20.353 TRACE 1 --- [or-http-epoll-1] o.s.w.s.adapter.HttpWebHandlerAdapter    : [c4b942d2-2] HTTP GET "/openapi/v3/api-docs/swagger-config", headers={masked}
2022-05-21T10:28:20.357474900Z 2022-05-21 10:28:20.357 TRACE 1 --- [     parallel-3] o.s.c.g.f.WeightCalculatorWebFilter      : Weights attr: {}
2022-05-21T10:28:20.359609000Z 2022-05-21 10:28:20.359 TRACE 1 --- [     parallel-3] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/chat-composite/**]" does not match against value "/openapi/v3/api-docs/swagger-config"
2022-05-21T10:28:20.359882000Z 2022-05-21 10:28:20.359 TRACE 1 --- [     parallel-3] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/oauth2/**]" does not match against value "/openapi/v3/api-docs/swagger-config"
2022-05-21T10:28:20.360401000Z 2022-05-21 10:28:20.360 TRACE 1 --- [     parallel-3] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/login/**]" does not match against value "/openapi/v3/api-docs/swagger-config"
2022-05-21T10:28:20.361139700Z 2022-05-21 10:28:20.360 TRACE 1 --- [     parallel-3] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/error/**]" does not match against value "/openapi/v3/api-docs/swagger-config"
2022-05-21T10:28:20.361930900Z 2022-05-21 10:28:20.361 TRACE 1 --- [     parallel-3] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "/openapi/**" matches against value "/openapi/v3/api-docs/swagger-config"
2022-05-21T10:28:20.362281600Z 2022-05-21 10:28:20.362 DEBUG 1 --- [     parallel-3] o.s.c.g.h.RoutePredicateHandlerMapping   : Route matched: chat-composite-swagger-ui
2022-05-21T10:28:20.377665900Z 2022-05-21 10:28:20.364 DEBUG 1 --- [     parallel-3] o.s.c.g.h.RoutePredicateHandlerMapping   : Mapping [Exchange: GET https://localhost:8443/openapi/v3/api-docs/swagger-config] to Route{id='chat-composite-swagger-ui', uri=lb://chat-composite, order=0, predicate=Paths: [/openapi/**], match trailing slash: true, gatewayFilters=[], metadata={}}
2022-05-21T10:28:20.378023300Z 2022-05-21 10:28:20.377 DEBUG 1 --- [     parallel-3] o.s.c.g.h.RoutePredicateHandlerMapping   : [c4b942d2-2] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@183ff136
2022-05-21T10:28:20.394645500Z 2022-05-21 10:28:20.393 DEBUG 1 --- [     parallel-3] o.s.c.g.handler.FilteringWebHandler      : Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@2673487b}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@6e948f1c}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@3de56885}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@194224ca}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@350f18a6}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@2d07aacc}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@2fb48970}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@254e9709}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@4e8d9bb6}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@ff5d4f1}, order = 2147483647]]
2022-05-21T10:28:20.394694200Z 2022-05-21 10:28:20.393 TRACE 1 --- [     parallel-3] o.s.c.g.filter.RouteToRequestUrlFilter   : RouteToRequestUrlFilter start
2022-05-21T10:28:20.394702600Z 2022-05-21 10:28:20.394 TRACE 1 --- [     parallel-3] s.c.g.f.ReactiveLoadBalancerClientFilter : ReactiveLoadBalancerClientFilter url before: lb://chat-composite/openapi/v3/api-docs/swagger-config
2022-05-21T10:28:20.415089200Z 2022-05-21 10:28:20.395 TRACE 1 --- [     parallel-3] s.c.g.f.ReactiveLoadBalancerClientFilter : LoadBalancerClientFilter url chosen: http://64885baa833a:8080/openapi/v3/api-docs/swagger-config
2022-05-21T10:28:20.433535900Z 2022-05-21 10:28:20.429 TRACE 1 --- [or-http-epoll-3] o.s.c.gateway.filter.NettyRoutingFilter  : outbound route: 61ed3201, inbound: [c4b942d2-2] 
2022-05-21T10:28:20.457616300Z 2022-05-21 10:28:20.457 TRACE 1 --- [or-http-epoll-3] o.s.c.g.filter.NettyWriteResponseFilter  : NettyWriteResponseFilter start inbound: 61ed3201, outbound: [c4b942d2-2] 
2022-05-21T10:28:20.463107900Z 2022-05-21 10:28:20.462 TRACE 1 --- [or-http-epoll-3] o.s.c.g.filter.GatewayMetricsFilter      : spring.cloud.gateway.requests tags: [tag(httpMethod=GET),tag(httpStatusCode=200),tag(outcome=SUCCESSFUL),tag(routeId=chat-composite-swagger-ui),tag(routeUri=lb://chat-composite),tag(status=OK)]
2022-05-21T10:28:20.470349500Z 2022-05-21 10:28:20.469 TRACE 1 --- [or-http-epoll-1] o.s.w.s.adapter.HttpWebHandlerAdapter    : [c4b942d2-2] Completed 200 OK, headers={masked}
2022-05-21T10:28:20.507352600Z 2022-05-21 10:28:20.506 TRACE 1 --- [or-http-epoll-1] o.s.w.s.adapter.HttpWebHandlerAdapter    : [c4b942d2-3] HTTP GET "/openapi/v3/api-docs", headers={masked}
2022-05-21T10:28:20.513083200Z 2022-05-21 10:28:20.512 TRACE 1 --- [     parallel-4] o.s.c.g.f.WeightCalculatorWebFilter      : Weights attr: {}
2022-05-21T10:28:20.517904600Z 2022-05-21 10:28:20.517 TRACE 1 --- [     parallel-4] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/chat-composite/**]" does not match against value "/openapi/v3/api-docs"
2022-05-21T10:28:20.519739000Z 2022-05-21 10:28:20.519 TRACE 1 --- [     parallel-4] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/oauth2/**]" does not match against value "/openapi/v3/api-docs"
2022-05-21T10:28:20.520845100Z 2022-05-21 10:28:20.520 TRACE 1 --- [     parallel-4] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/login/**]" does not match against value "/openapi/v3/api-docs"
2022-05-21T10:28:20.521781700Z 2022-05-21 10:28:20.521 TRACE 1 --- [     parallel-4] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/error/**]" does not match against value "/openapi/v3/api-docs"
2022-05-21T10:28:20.535671600Z 2022-05-21 10:28:20.535 TRACE 1 --- [     parallel-4] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "/openapi/**" matches against value "/openapi/v3/api-docs"
2022-05-21T10:28:20.535770000Z 2022-05-21 10:28:20.535 DEBUG 1 --- [     parallel-4] o.s.c.g.h.RoutePredicateHandlerMapping   : Route matched: chat-composite-swagger-ui
2022-05-21T10:28:20.536073500Z 2022-05-21 10:28:20.535 DEBUG 1 --- [     parallel-4] o.s.c.g.h.RoutePredicateHandlerMapping   : Mapping [Exchange: GET https://localhost:8443/openapi/v3/api-docs] to Route{id='chat-composite-swagger-ui', uri=lb://chat-composite, order=0, predicate=Paths: [/openapi/**], match trailing slash: true, gatewayFilters=[], metadata={}}
2022-05-21T10:28:20.536320600Z 2022-05-21 10:28:20.536 DEBUG 1 --- [     parallel-4] o.s.c.g.h.RoutePredicateHandlerMapping   : [c4b942d2-3] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@183ff136
2022-05-21T10:28:20.536616000Z 2022-05-21 10:28:20.536 DEBUG 1 --- [     parallel-4] o.s.c.g.handler.FilteringWebHandler      : Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@2673487b}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@6e948f1c}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@3de56885}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@194224ca}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@350f18a6}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@2d07aacc}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@2fb48970}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@254e9709}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@4e8d9bb6}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@ff5d4f1}, order = 2147483647]]
2022-05-21T10:28:20.537474400Z 2022-05-21 10:28:20.537 TRACE 1 --- [     parallel-4] o.s.c.g.filter.RouteToRequestUrlFilter   : RouteToRequestUrlFilter start
2022-05-21T10:28:20.538885700Z 2022-05-21 10:28:20.537 TRACE 1 --- [     parallel-4] s.c.g.f.ReactiveLoadBalancerClientFilter : ReactiveLoadBalancerClientFilter url before: lb://chat-composite/openapi/v3/api-docs
2022-05-21T10:28:20.539195000Z 2022-05-21 10:28:20.538 TRACE 1 --- [     parallel-4] s.c.g.f.ReactiveLoadBalancerClientFilter : LoadBalancerClientFilter url chosen: http://64885baa833a:8080/openapi/v3/api-docs
2022-05-21T10:28:20.541667600Z 2022-05-21 10:28:20.541 TRACE 1 --- [or-http-epoll-2] o.s.c.gateway.filter.NettyRoutingFilter  : outbound route: a70962ea, inbound: [c4b942d2-3] 
2022-05-21T10:28:20.856769100Z 2022-05-21 10:28:20.856 TRACE 1 --- [or-http-epoll-2] o.s.c.g.filter.NettyWriteResponseFilter  : NettyWriteResponseFilter start inbound: a70962ea, outbound: [c4b942d2-3] 
2022-05-21T10:28:20.858264800Z 2022-05-21 10:28:20.857 TRACE 1 --- [or-http-epoll-2] o.s.c.g.filter.GatewayMetricsFilter      : spring.cloud.gateway.requests tags: [tag(httpMethod=GET),tag(httpStatusCode=200),tag(outcome=SUCCESSFUL),tag(routeId=chat-composite-swagger-ui),tag(routeUri=lb://chat-composite),tag(status=OK)]
2022-05-21T10:28:20.862162000Z 2022-05-21 10:28:20.861 TRACE 1 --- [or-http-epoll-1] o.s.w.s.adapter.HttpWebHandlerAdapter    : [c4b942d2-3] Completed 200 OK, headers={masked}
2022-05-21T10:28:26.810099500Z 2022-05-21 10:28:26.794 TRACE 1 --- [or-http-epoll-1] o.s.w.s.adapter.HttpWebHandlerAdapter    : [c4b942d2-4] HTTP GET "/oauth2/authorize?response_type=code&client_id=writer&redirect_uri=https%3A%2F%2Flocalhost%3A8443%2Fopenapi%2Fwebjarshttps%3A%2Flocalhost%3A8443%2Fwebjars%2Fswagger-ui%2Foauth2-redirect.html&scope=chat%3Aread%20chat%3Awrite&state=U2F0IE1heSAyMSAyMDIyIDEyOjI4OjI2IEdNVCswMjAwIChDZW50cmFsIEV1cm9wZWFuIFN1bW1lciBUaW1lKQ%3D%3D", headers={masked}
2022-05-21T10:28:26.810172200Z 2022-05-21 10:28:26.796 TRACE 1 --- [     parallel-1] o.s.c.g.f.WeightCalculatorWebFilter      : Weights attr: {}
2022-05-21T10:28:26.810184900Z 2022-05-21 10:28:26.798 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "[/chat-composite/**]" does not match against value "/oauth2/authorize"
2022-05-21T10:28:26.810192000Z 2022-05-21 10:28:26.799 TRACE 1 --- [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "/oauth2/**" matches against value "/oauth2/authorize"
2022-05-21T10:28:26.810199200Z 2022-05-21 10:28:26.799 DEBUG 1 --- [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : Route matched: oauth2-server
2022-05-21T10:28:26.810627300Z 2022-05-21 10:28:26.800 DEBUG 1 --- [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : Mapping [Exchange: GET https://localhost:8443/oauth2/authorize?response_type=code&client_id=writer&redirect_uri=https%3A%2F%2Flocalhost%3A8443%2Fopenapi%2Fwebjarshttps%3A%2Flocalhost%3A8443%2Fwebjars%2Fswagger-ui%2Foauth2-redirect.html&scope=chat%3Aread%20chat%3Awrite&state=U2F0IE1heSAyMSAyMDIyIDEyOjI4OjI2IEdNVCswMjAwIChDZW50cmFsIEV1cm9wZWFuIFN1bW1lciBUaW1lKQ%3D%3D] to Route{id='oauth2-server', uri=lb://auth-server, order=0, predicate=Paths: [/oauth2/**], match trailing slash: true, gatewayFilters=[], metadata={}}
2022-05-21T10:28:26.811199600Z 2022-05-21 10:28:26.810 DEBUG 1 --- [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : [c4b942d2-4] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@183ff136
2022-05-21T10:28:26.811785500Z 2022-05-21 10:28:26.811 DEBUG 1 --- [     parallel-1] o.s.c.g.handler.FilteringWebHandler      : Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@2673487b}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@6e948f1c}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@3de56885}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@194224ca}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@350f18a6}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@2d07aacc}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@2fb48970}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@254e9709}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@4e8d9bb6}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@ff5d4f1}, order = 2147483647]]
2022-05-21T10:28:26.812079400Z 2022-05-21 10:28:26.811 TRACE 1 --- [     parallel-1] o.s.c.g.filter.RouteToRequestUrlFilter   : RouteToRequestUrlFilter start
2022-05-21T10:28:26.814073700Z 2022-05-21 10:28:26.813 TRACE 1 --- [     parallel-1] s.c.g.f.ReactiveLoadBalancerClientFilter : ReactiveLoadBalancerClientFilter url before: lb://auth-server/oauth2/authorize?response_type=code&client_id=writer&redirect_uri=https%3A%2F%2Flocalhost%3A8443%2Fopenapi%2Fwebjarshttps%3A%2Flocalhost%3A8443%2Fwebjars%2Fswagger-ui%2Foauth2-redirect.html&scope=chat%3Aread%20chat%3Awrite&state=U2F0IE1heSAyMSAyMDIyIDEyOjI4OjI2IEdNVCswMjAwIChDZW50cmFsIEV1cm9wZWFuIFN1bW1lciBUaW1lKQ%3D%3D
2022-05-21T10:28:27.063010800Z 2022-05-21 10:28:27.062 TRACE 1 --- [     parallel-1] s.c.g.f.ReactiveLoadBalancerClientFilter : LoadBalancerClientFilter url chosen: http://07721888c636:9999/oauth2/authorize?response_type=code&client_id=writer&redirect_uri=https%3A%2F%2Flocalhost%3A8443%2Fopenapi%2Fwebjarshttps%3A%2Flocalhost%3A8443%2Fwebjars%2Fswagger-ui%2Foauth2-redirect.html&scope=chat%3Aread%20chat%3Awrite&state=U2F0IE1heSAyMSAyMDIyIDEyOjI4OjI2IEdNVCswMjAwIChDZW50cmFsIEV1cm9wZWFuIFN1bW1lciBUaW1lKQ%3D%3D
2022-05-21T10:28:27.095261600Z 2022-05-21 10:28:27.094 TRACE 1 --- [or-http-epoll-4] o.s.c.gateway.filter.NettyRoutingFilter  : outbound route: e6721659, inbound: [c4b942d2-4] 
2022-05-21T10:28:27.191227400Z 2022-05-21 10:28:27.190 TRACE 1 --- [or-http-epoll-4] o.s.c.g.filter.NettyWriteResponseFilter  : NettyWriteResponseFilter start inbound: e6721659, outbound: [c4b942d2-4] 
2022-05-21T10:28:27.208316900Z 2022-05-21 10:28:27.207 TRACE 1 --- [or-http-epoll-4] o.s.c.g.filter.GatewayMetricsFilter      : spring.cloud.gateway.requests tags: [tag(httpMethod=GET),tag(httpStatusCode=400),tag(outcome=CLIENT_ERROR),tag(routeId=oauth2-server),tag(routeUri=lb://auth-server),tag(status=BAD_REQUEST)]
2022-05-21T10:28:27.212761900Z 2022-05-21 10:28:27.212 TRACE 1 --- [or-http-epoll-1] o.s.w.s.adapter.HttpWebHandlerAdapter    : [c4b942d2-4] Completed 400 BAD_REQUEST, headers={masked}
2022-05-21T10:28:27.442098700Z 2022-05-21 10:28:27.441 TRACE 1 --- [or-http-epoll-1] o.s.w.s.adapter.HttpWebHandlerAdapter    : [c4b942d2-5] HTTP GET "/favicon.ico", headers={masked}
2022-05-21T10:28:27.507677300Z 2022-05-21 10:28:27.507 TRACE 1 --- [     parallel-3] o.s.w.s.adapter.HttpWebHandlerAdapter    : [c4b942d2-5] Completed 401 UNAUTHORIZED, headers={masked}
2022-05-21T10:32:05.667228300Z 2022-05-21 10:32:05.666  INFO 1 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration

image

could you help me please?

slowbreathing commented 2 years ago

Same problem.

magnus-larsson commented 2 years ago

Hello and thanks for reporting this problem!

It seems like the upgrade to springdoc-openapi v1.5.9 (due to upgrading Spring Boot from 2.4.4 to 2.5.2) broke this functionality.

I will look into how to reestablish the functionality, but meanwhile you can downgrade the Product Composite service to springdoc-openapi v1.5.2 to make it work again.

Replace the following in $BOOK_HOME/Chapter11/microservices/product-composite-service/build.gradle:

  1. Replace:

    id 'org.springframework.boot' version '2.5.2'

    With:

    id 'org.springframework.boot' version '2.4.4'
  2. Replace:

    springCloudVersion = "2020.0.3"

    With:

    springCloudVersion = "2020.0.2"
  3. Replace:

    implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.5.9'

    With:

    implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.5.2'
    implementation 'org.springdoc:springdoc-openapi-common:1.5.2'

Also in $BOOK_HOME/Chapter11/test-em-all.bash, replace:

assertCurl 302 "curl -ks  https://$HOST:$PORT/openapi/swagger-ui.html"

With:

assertCurl 307 "curl -ks  https://$HOST:$PORT/openapi/swagger-ui.html"

Sorry for the inconvenience, Magnus.

ahmedAbouismail commented 2 years ago

@magnus-larsson Thank you for your reply. It solved the problem. :)

Partyschaum commented 2 years ago

I think I found the underlying problem: https://github.com/spring-projects/spring-authorization-server/issues/680

I'm not sure when this change has been introduced but I started my project with the Authorization Server in version 0.2.1 and now use 0.2.3 and using https://127.0.0.1:8443/webjars/swagger-ui/oauth2-redirect.html as redirect URI did the trick. It now works!

Edit: No, it does not. The OAuth-Dance works and I get redirected to https://127.0.0.1:8443/webjars/swagger-ui/oauth2-redirect.html?code=_qfCbxYGmOCr3... and even get a 200 response code but nothing is displayed. In the my browser's console, I see the following error:

Uncaught DOMException: Blocked a frame with origin "https://127.0.0.1:8443" from accessing a cross-origin frame.
    at run (https://127.0.0.1:8443/webjars/swagger-ui/oauth2-redirect.html?code=pNWgJpEVMFqf3PWtbxhlA3ltZ4Qtl3xmpabR_cg_eWmrRc1qc1LbSrHzKCoftQe6knpILA51xk2IBfLJutkL12LThPAdwizbWWkh8-S7Zk8ULjut-iT0z3Ld32MUkXEv&state=VGh1IEp1biAxNiAyMDIyIDE2OjQzOjMzIEdNVCswMjAwIChDZW50cmFsIEV1cm9wZWFuIFN1bW1lciBUaW1lKQ%3D%3D:10:36)
    at HTMLDocument.<anonymous> (https://127.0.0.1:8443/webjars/swagger-ui/oauth2-redirect.html?code=pNWgJpEVMFqf3PWtbxhlA3ltZ4Qtl3xmpabR_cg_eWmrRc1qc1LbSrHzKCoftQe6knpILA51xk2IBfLJutkL12LThPAdwizbWWkh8-S7Zk8ULjut-iT0z3Ld32MUkXEv&state=VGh1IEp1biAxNiAyMDIyIDE2OjQzOjMzIEdNVCswMjAwIChDZW50cmFsIEV1cm9wZWFuIFN1bW1lciBUaW1lKQ%3D%3D:74:13)

So, still not working but at least one tiny step closer to the problem. 😉

webmakaka commented 2 years ago

@Partyschaum I applied Magnus recommendations and it started to work

AppleH264 commented 1 year ago

Fixed without any version changes:

  1. in product-composite yml: remove or comment out (default works fine) or remove https://localhost:8443/webjars prefix (it will be injected by the springdoc based on client request url): oauth2-redirect-url: https://localhost:8443/webjars/swagger-ui/oauth2-redirect.html
  2. in AuthorizationServerConfig.java: change: .redirectUri("https://localhost:8443/webjars/swagger-ui/oauth2-redirect.html") to .redirectUri("https://localhost:8443/openapi/webjars/swagger-ui/oauth2-redirect.html") for both clients - writer and reader

    after this you will be rewarded with:

security_auth (OAuth2, authorizationCode) Authorized Authorization URL: https://localhost:8443/oauth2/authorize

Token URL: https://localhost:8443/oauth2/token

Flow: authorizationCode

client_id: ** client_secret: **

AppleH264 commented 1 year ago

It also works with Auth0 - just make sure you use (replace {TENANT} with yours): tokenUrl: https://{TENANT}/oauth/token

You could gather all urls used ny Auth0 with this command from the book: curl https://${TENANT}/.well-known/openid-configuration -s | jq

And now, swagger is working with Auth0

AppleH264 commented 1 year ago

In kubernetes the swagger needs adjustment when moving to ingress service to point to the host minikube.me in auth service code for writer and reader redirect url and product-composite config for swagger. Unfortunately, it would not be able to authorize swagger due to https://minikube.me/login" returning 404. The url should be: https://minikube.me:8443/login. The redirect url is also missing port. So it looks like ingress does not forward port (X-Forwarded-Port) to the services in the cluster. I think it is Windows specific as ingress is using 8443 and 8080, on Mac it is using default http(80) and https(443) ports, so this issue is not apparent and swagger is working fine as it does not need port overrides.

As I expected the swagger is working fine in Chapter16 after reconfiguration for port 30443 for fixes to urls above. In Chapter 18 the minikube ingress will be replaced with istio ingress gateway and hopefully this one works correctly with port forwarding. Not so fast, it got even worse as you can not access minikube tunnel from host OS (Windows) - it only available in ubuntu guest OS, but it has no GUI. Time to migrate to Mac OS to continue.

AndyLau223 commented 1 year ago

Hello and thanks for reporting this problem!

It seems like the upgrade to springdoc-openapi v1.5.9 (due to upgrading Spring Boot from 2.4.4 to 2.5.2) broke this functionality.

I will look into how to reestablish the functionality, but meanwhile you can downgrade the Product Composite service to springdoc-openapi v1.5.2 to make it work again.

Replace the following in $BOOK_HOME/Chapter11/microservices/product-composite-service/build.gradle:

  1. Replace:

    id 'org.springframework.boot' version '2.5.2'

    With:

    id 'org.springframework.boot' version '2.4.4'
  2. Replace:

    springCloudVersion = "2020.0.3"

    With:

    springCloudVersion = "2020.0.2"
  3. Replace:

    implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.5.9'

    With:

    implementation 'org.springdoc:springdoc-openapi-webflux-ui:1.5.2'
    implementation 'org.springdoc:springdoc-openapi-common:1.5.2'

Also in $BOOK_HOME/Chapter11/test-em-all.bash, replace:

assertCurl 302 "curl -ks  https://$HOST:$PORT/openapi/swagger-ui.html"

With:

assertCurl 307 "curl -ks  https://$HOST:$PORT/openapi/swagger-ui.html"

Sorry for the inconvenience, Magnus.

Thanks Magnus for the efforts to make it works.