knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject knox git commit: KNOX-902 - Fix the hardcoded knoxsso topology name (Attila Kanto via Sandeep More)
Date Wed, 08 Mar 2017 19:05:17 GMT
Repository: knox
Updated Branches:
  refs/heads/master f9da2747a -> 56176ef44


KNOX-902 - Fix the hardcoded knoxsso topology name (Attila Kanto via Sandeep More)


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/56176ef4
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/56176ef4
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/56176ef4

Branch: refs/heads/master
Commit: 56176ef442f1ff605d7701ec610bccc7a0375131
Parents: f9da274
Author: Sandeep More <more@apache.org>
Authored: Wed Mar 8 14:03:13 2017 -0500
Committer: Sandeep More <more@apache.org>
Committed: Wed Mar 8 14:03:13 2017 -0500

----------------------------------------------------------------------
 .../main/resources/applications/knoxauth/app/js/knoxauth.js  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/56176ef4/gateway-applications/src/main/resources/applications/knoxauth/app/js/knoxauth.js
----------------------------------------------------------------------
diff --git a/gateway-applications/src/main/resources/applications/knoxauth/app/js/knoxauth.js
b/gateway-applications/src/main/resources/applications/knoxauth/app/js/knoxauth.js
index 339005a..13c2051 100644
--- a/gateway-applications/src/main/resources/applications/knoxauth/app/js/knoxauth.js
+++ b/gateway-applications/src/main/resources/applications/knoxauth/app/js/knoxauth.js
@@ -15,7 +15,8 @@
  * limitations under the License.
  */
 
-var loginURL = "/gateway/knoxsso/api/v1/websso?originalUrl=";
+var loginPageSuffix = "/knoxauth/login.html";
+var webssoURL = "/api/v1/websso?originalUrl=";
 var userAgent = navigator.userAgent.toLowerCase();
 var firstLogIn = true;
 
@@ -46,6 +47,9 @@ var keypressed = function(event) {
 }
 
 var login = function() {
+    var pathname = window.location.pathname;
+    var topologyContext = pathname.replace(loginPageSuffix, "");;
+    var loginURL = topologyContext + webssoURL;
     var form = document.forms[0];
     var username = form.username.value;
     var password = form.password.value;
@@ -55,7 +59,7 @@ var login = function() {
     var redirectUrl = originalUrl;
       //Instantiate HTTP Request
         var request = ((window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"));
-        request.open("POST", loginURL + originalUrl, true);
+        request.open("POST", idpUrl, true);
         request.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + password))
         request.send(null);
 


Mime
View raw message