[英]Using Auth0 in Spring Cloud Gateway, problem with getting ID Token
我們在使用 auth0 SDK 獲取 ID 令牌時遇到問題。我們有基於 Spring 雲網關(版本 3.1.4)的 API 網關,我們嘗試使用您的 auth0 平台對用戶進行身份驗證,然后將交換路由到我們的微服務。 為此,我們想使用 ID Token 並從中獲取 email 並將此 email 傳遞 ...
[英]Using Auth0 in Spring Cloud Gateway, problem with getting ID Token
我們在使用 auth0 SDK 獲取 ID 令牌時遇到問題。我們有基於 Spring 雲網關(版本 3.1.4)的 API 網關,我們嘗試使用您的 auth0 平台對用戶進行身份驗證,然后將交換路由到我們的微服務。 為此,我們想使用 ID Token 並從中獲取 email 並將此 email 傳遞 ...
[英]Spring Cloud Gateway Token Relay: who is the OAuth2 client?
我正在探索 Spring 雲網關的 TokenRelay 過濾器,以便在 SAML2 Session 和 OAuth2 令牌之間進行調解(在我之前的問題中有更多相關信息)。 我試圖自己解決這個問題,但我似乎無法解決:使用這個過濾器,誰是 OAuth2 客戶端? 我原以為這是網關本身,因此是機密的。 ...
[英]Oauth2 Login in Spring Cloud Gateway using KeyCloak
我使用 KeyCLoak 在 Spring 雲網關中實現了 oauth2。 現在我希望所有請求都被允許,除了那些在 url 中有“/user”的請求。以下是我的安全配置 我期待當用戶輸入 url“http://localhost:8066/user”時,它會將他們重定向到 keycloak 登錄頁面 ...
[英]Spring Cloud Gateway: how to redirect to other host
我有一個應該重定向到另一台服務器的請求/路由。 為此,我認為使用來自“spring-cloud-gateway”的重定向過濾器應該是正確的。 示例: http://localhost:8080/site/rest/services/testservice/1 應該重定向到https://intern ...
[英]spring gateway always returns 301, how to continue processing
這是OP的澄清我有一個 spring 網關,它使用 eureka 服務器將請求路由到已注冊的 spring boot eureka 客戶端。 我看到的是每個請求都會導致包含位置 header 的 301 重定向。似乎是因為在https://my-api.io/payment/payment-inte ...
[英]How to get trace-id in spring-cloud-gateway using micrometer-brave
我想在 Spring 雲網關中的每個請求的日志中顯示 traceId。 但是,traceId 和 spanId 只是空的。 日志配置如下: logging: pattern: level: "%5p [TRACE_ID: %X{traceId:-}] [SPAN_ID: %X{spanId:-} ...
[英]Redirect to Frontend app after successful login in keycloak
我有通過 spring 雲網關連接到資源服務器的反應應用程序。現在,如果用戶未通過身份驗證 Spring 雲網關將請求重定向到 Keycloak 登錄頁面,成功登錄並從 api 獲得響應后,我需要重定向到前端應用程序,但它是在瀏覽器中顯示 api 響應。下面是 api 網關中的 oauth 配置。 ...
[英]Keycloak logout give cors error coming how to resolve it?
我正在構建一個 spring 雲網關並嘗試注銷 keycloak 但它給了我 cors 錯誤,我的代碼如下: Security class 其中我定義了注銷代碼邏輯: 現在,當我從前端點擊注銷時,它給了我以下錯誤: 在 Keycloak 中有效的 URL 我已經給出 * 進行測試但仍然無法正常工 ...
[英]In Spring cloud gateway api how add dynamic headers or query parameter?
我正在開發使用 spring 雲網關和前端 Angular 2 的應用程序,登錄時我使用 Keyclock SSO,但登錄后我需要通過以下方式以某種加密格式在前端發送一些用戶信息標頭或查詢參數,因此在 spring 雲網關中,我已經編寫了下面的代碼,但它不起作用,請幫忙。 這是我的自定義 Glob ...
[英]Spring Cloud Gateway Filter with external configuration service call
我正在開發一個 Spring Cloud Gateway 應用程序,它有一個過濾器,可以根據不同服務持有的配置控制對某些路徑或功能的訪問。 因此,如果路徑與功能 x 關聯,則僅當配置服務返回功能 x 已啟用時才允許訪問。 配置以 Mono 的形式返回,然后進行平面映射以檢查啟用的功能。 這一切似乎都 ...
[英]Feign Client with Spring Cloud GatewayFilter cause cycle dependency
在某些檢查期間,我需要在網關過濾器中向我的微服務發出請求。 當我在 GatewayFilter(我的 SecurityFilter.java)class 中定義 Feign class 時,它會出現以下錯誤。 我該如何解決這種情況。 錯誤: 網關過濾器 class pom.xml 主 class ...
[英]spring-cloud-starter-gateway dependency issue
錯誤: org.springframework.cloud:spring-cloud-starter-gateway:pom:4.0.0 在之前的嘗試中無法從https://repo.maven.apache.org/maven2傳輸。 此故障已緩存在本地存儲庫中,並且在中央更新間隔結束或強制更新 ...
[英]How to use Keycloak token between Microservices?
我正在構建一個適用於微服務的應用程序,我正在使用 Keycloak 驗證我的網關我的身份驗證工作正常網關將我重定向到 Keycloak 登錄頁面並成功完成登錄,我能夠獲得令牌 ID 並將此 ID 傳遞給其他人微服務,但是當我再次從任何其他微服務向網關發出 rest 請求時,它失敗了,但我在網關的“ ...
[英]Why SecurityContextHolder.getContext().getAuthentication() returning null value?
我正在嘗試使用 keycloak 身份驗證在 spring-cloud-gateway 中構建身份驗證,並且一切正常,但是當嘗試獲取 SecurityContextHolder.getContext().getAuthentication() 時,它給出了 null 我不確定為什么? 這是我的代碼 ...
[英]White label error on page refresh on react SPA running in spring cloud gateway
我正在研究 spring-boot React 全棧應用程序。 我使用 spring 雲網關作為我的 API 網關將請求路由到上游微服務。 另外,我的 React SPA 也在 spring 雲網關上運行。 當我運行 spring 雲網關應用程序時,我能夠加載前端 GUI。 當我瀏覽 GUI 時它工 ...
[英]How do I write a unit test for a Spring Cloud Reactive API Gateway's Custom Filter to test if it allows requests to public endpoints to pass?
我正在嘗試為微服務架構中的 Spring Cloud Reactive API Gateway 的 authAccountFilter 編寫單元測試。 網關使用 WebFlux,authAccountFilter 負責檢查端點是公共的還是安全的。 如果是公共端點,則允許請求通過。 但是,如果它是安 ...
[英]Spring Cloud Gateway, logging request/response
我的 GlobalFilter 只記錄成功的請求 (200)。 例如,代碼 500 不通過 ServerHttpRequestDecorator 和 ServerHttpResponseDecorator。 ServerResponse.status(HttpStatus.valueOf(stat ...
[英]Strange behaviour server side load balancing in Spring Cloud Gateway with Netflix Eureka
我正在嘗試使用 SpringCloudGateway 和 Eureka 實現服務器端 LB。 我有微服務 ABC (abc.test.com) 和網關 (gateway.test.com) 通過主機名在 eureka (eureka.test.com) 中注冊。 如果我從本地機器上的 postman ...
[英]Is there is a way to register microservice with domain name to netflix eureka?
我正面臨尤里卡配置問題 - 是否可以通過域名如“https://www.google.com”(例如通過 ENV 變量傳遞給屬性)而不是 ip 地址(我是在沒有 static ip 地址的地方使用 PAAS 或主機名(通常是供應商的名稱)? 我試過設置尤里卡 要么 但它並沒有達到我想要達到的目的。 ...
[英]GatewayFilter reactor mechanism
我是反應堆的新手,想了解以下代碼之間的區別。 兩者有何不同? (最后給出的其余代碼) 對比 我知道版本 B 不起作用,因為兩個onErrorResume()返回Mono<Void> ,而sample()返回Mono<String> 。 但除此之外,我想了解的是,對於版本 A ...