KNOX-1274 - Update location headers to make sure SSO redirects are proper (Marco...
authorSandeep More <more@apache.org>
Fri, 11 May 2018 15:17:24 +0000 (11:17 -0400)
committerSandeep More <more@apache.org>
Fri, 11 May 2018 15:17:24 +0000 (11:17 -0400)
gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/rewrite.xml
gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/service.xml

index 484f267..b5df3c9 100644 (file)
       <apply path="static" rule="SPARKHISTORYUI/sparkhistory/outbound/historypage/static"/>
     </content>
   </filter>
-</rules>
\ No newline at end of file
+
+  <!-- re-write rule for location when SHS redirects to Knox SSO login page -->
+  <rule dir="OUT" name="SPARKHISTORYUI/sparkhistory/outbound/headers/location/sso">
+    <match pattern="{scheme}://{host}:{port}/{gateway}/{knoxsso}/{api}/{v}/websso?originalUrl={**}"/>
+    <rewrite template="{scheme}://{host}:{port}/{gateway}/{knoxsso}/{api}/{v}/websso?originalUrl={$postfix[url,/sparkhistory/]}"/>
+  </rule>
+  <filter name="SPARKHISTORYUI/sparkhistory/outbound/headers/sso/filter">
+    <content type="application/x-http-headers">
+      <apply path="Location" rule="SPARKHISTORYUI/sparkhistory/outbound/headers/location/sso"/>
+    </content>
+  </filter>
+</rules>
index f6ae415..aa370a1 100644 (file)
     <routes>
         <route path="/sparkhistory/">
             <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/rqheaders" to="request.headers"/>
+            <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/headers/sso/filter" to="response.headers"/>
         </route>
         <route path="/sparkhistory/**">
             <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/rqheaders" to="request.headers"/>
+            <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/headers/sso/filter" to="response.headers"/>
         </route>
         <route path="/sparkhistory/**?**"/>
         <route path="/sparkhistory/static/historypage.js">