[英]Spring Cloud Data Flow security configuracion and integration with RedHat SSO
我們正在嘗試按照文檔( https://docs.spring.io#configuration-cloud-current-dataflow/sdocsle/有一些我們無法填補的知識空白。
根據第 9.2 點,可以使用 OAuth 2.0 配置身份驗證並將其與 SSO 集成。 我們使用 RedHat SSO,因此我們正在嘗試將兩者集成,但我們無法使其正常工作,是否可能或使用的 SSO 存在限制?
根據文檔,我們設置了這些屬性:
所以我們有一些考慮:
最后,我們在 Docker 容器中運行的 SCDF 中測試了配置,但它“什么也沒做”:
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] org.apache.tomcat.util.http.Parameters : Set query string encoding to UTF-8
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] o.a.t.util.http.Rfc6265CookieProcessor : Cookies: Parsing b[]: JSESSIONID=55694CBB4F694DD2E345AF61AF90B05D
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] o.a.catalina.connector.CoyoteAdapter : Requested cookie session id is 55694CBB4F694DD2E345AF61AF90B05D
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] o.a.c.authenticator.AuthenticatorBase : Security checking request POST /tasks/executions
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] org.apache.catalina.realm.RealmBase : No applicable constraints defined
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] o.a.c.a.jaspic.AuthConfigFactoryImpl : Loading persistent provider registrations from [/tmp/tomcat.1807897745863872641.9393/conf/jaspic-providers.xml]
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] o.a.c.authenticator.AuthenticatorBase : Not subject to any constraint
dataflow-server | INFO 1 --- [nio-9393-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] o.apache.catalina.core.StandardWrapper : Returning non-STM instance
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] org.apache.tomcat.util.http.Parameters : Set encoding to UTF-8
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] org.apache.tomcat.util.http.Parameters : Start processing with input [name=microapabatch&arguments=--my.arguments.sleep=2000+--my.arguments.forceFailure=false]
dataflow-server | TRACE 1 --- [nio-9393-exec-1] s.n.www.protocol.http.HttpURLConnection : ProxySelector Request for https://xxxxxxxxxxxxxxxxxxxxxxxx/openid-connect/token/introspect
dataflow-server | TRACE 1 --- [nio-9393-exec-1] s.n.www.protocol.http.HttpURLConnection : Looking for HttpClient for URL https://xxxxxxxxxxxxxxxxxxxxxxxx/openid-connect/token/introspect and proxy value of DIRECT
dataflow-server | TRACE 1 --- [nio-9393-exec-1] s.n.www.protocol.http.HttpURLConnection : Creating new HttpsClient with url:https://xxxxxxxxxxxxxxxxxxxxxxxx/openid-connect/token/introspect and proxy:DIRECT with connect timeout:-1
dataflow-server | TRACE 1 --- [nio-9393-exec-1] s.n.www.protocol.http.HttpURLConnection : Proxy used: DIRECT
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] o.a.tomcat.util.net.SocketWrapperBase : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1376a3b7:org.apache.tomcat.util.net.NioChannel@198ec8c7:java.nio.channels.SocketChannel[connected local=/172.18.0.4:9393 remote=/172.18.0.1:33758]], Read from buffer: [0]
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] org.apache.tomcat.util.net.NioEndpoint : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1376a3b7:org.apache.tomcat.util.net.NioChannel@198ec8c7:java.nio.channels.SocketChannel[connected local=/172.18.0.4:9393 remote=/172.18.0.1:33758]], Read direct from socket: [0]
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1376a3b7:org.apache.tomcat.util.net.NioChannel@198ec8c7:java.nio.channels.SocketChannel[connected local=/172.18.0.4:9393 remote=/172.18.0.1:33758]], Status in: [OPEN_READ], State out: [OPEN]
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] o.a.coyote.http11.Http11NioProtocol : Pushed Processor [org.apache.coyote.http11.Http11Processor@17492586]
dataflow-server | DEBUG 1 --- [nio-9393-exec-1] org.apache.tomcat.util.net.NioEndpoint : Registered read interest for [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1376a3b7:org.apache.tomcat.util.net.NioChannel@198ec8c7:java.nio.channels.SocketChannel[connected local=/172.18.0.4:9393 remote=/172.18.0.1:33758]]
似乎問題出在'remote=/172.18.0.1:33758',但我們無法解釋如何在這個本地IP中轉換內省uri。
這些都是簡單的 Spring 安全 OAuth 設置和概念在那里有更好的記錄。 我們正在為 keycloak 添加更好的擴展塢,但與此同時,我的舊測試dataflow-keycloak可能會幫助您入門。
在最近的版本中,我們添加了一種更好的方法來使用普通的 jwt 密鑰,我們為Azure/AD記錄了它。 計划是為 keycloak 添加類似的部分。
我相信僅通過使用issuer-uri和jwk-set-uri 就可以為您提供工作設置(您仍然需要弄清楚 scope 到角色映射),因為 Spring 安全性正在使用這些設置來自動配置 Z7C82E855B0415F27BD0Z92D2。 當我們還沒有完全使用 Spring 安全 5.3 線時,所有其他設置都有點舊。
對於 RH SSO,我不確定您是在談論一些全局共享實例還是您的私有設置。
對於像我這樣的新手,我將添加一些在 SCDF 中配置安全性時要考慮的要點
首先,對原始考慮的一些評論:
現在,我們用來使其工作的配置:
最后,SSO 方面的一些注意事項(這可能因使用的工具而異,這是針對 Keycloak/RedHatSSO 的):
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.