knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmc...@apache.org
Subject knox git commit: KNOX-686 - cleanup of some javascript and knoxsso.xml settings
Date Thu, 17 Mar 2016 15:49:46 GMT
Repository: knox
Updated Branches:
  refs/heads/master ce52a5542 -> 15ae0d781


KNOX-686 - cleanup of some javascript and knoxsso.xml settings

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

Branch: refs/heads/master
Commit: 15ae0d7818b5c1ff2710295437f410b1a5b4d3ed
Parents: ce52a55
Author: Larry McCay <lmccay@hortonworks.com>
Authored: Thu Mar 17 11:49:37 2016 -0400
Committer: Larry McCay <lmccay@hortonworks.com>
Committed: Thu Mar 17 11:49:37 2016 -0400

----------------------------------------------------------------------
 .../applications/knoxauth/js/knoxauth.js        | 42 --------------------
 .../home/conf/topologies/knoxsso.xml            |  6 +--
 2 files changed, 3 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/15ae0d78/gateway-applications/src/main/resources/applications/knoxauth/js/knoxauth.js
----------------------------------------------------------------------
diff --git a/gateway-applications/src/main/resources/applications/knoxauth/js/knoxauth.js
b/gateway-applications/src/main/resources/applications/knoxauth/js/knoxauth.js
index bc99f01..8f0efb1 100644
--- a/gateway-applications/src/main/resources/applications/knoxauth/js/knoxauth.js
+++ b/gateway-applications/src/main/resources/applications/knoxauth/js/knoxauth.js
@@ -16,7 +16,6 @@
  */
 
 var loginURL = "/gateway/knoxsso/api/v1/websso?originalUrl=";
-var logoutURL = "/WebServices/LogOff";
 var userAgent = navigator.userAgent.toLowerCase();
 var firstLogIn = true;
 
@@ -42,15 +41,10 @@ var login = function() {
         request.onreadystatechange = function(){
             if (request.readyState == 4) {
                 if (request.status==200 || request.status==204 || request.status==307 ||
request.status==303) {
-                  // window.location.replace(originalUrl);
-                  // window.location = originalUrl;
                   try { window.location.replace(originalUrl); } 
                   catch(e) { window.location = originalUrl; }
                 }
                 else {
-                    // if (navigator.userAgent.toLowerCase().indexOf("firefox") != -1){
-                    //     logoff();
-                    // }
                   if (request.status==401) {
                     $('#errorBox').show();
                     $('#signInLoading').hide();
@@ -62,7 +56,6 @@ var login = function() {
         }
     }
 
-    var userAgent = navigator.userAgent.toLowerCase();
     if (userAgent.indexOf("firefox") != -1){ //TODO: check version number
         if (firstLogIn) _login();
         else logoff(_login);
@@ -72,39 +65,4 @@ var login = function() {
     }
 
     if (firstLogIn) firstLogIn = false;
-}
-
-var logoff = function(callback){
-
-    if (userAgent.indexOf("msie") != -1) {
-        document.execCommand("ClearAuthenticationCache");
-    }
-    else if (userAgent.indexOf("firefox") != -1){ //TODO: check version number
-
-        var request1 = new XMLHttpRequest();
-        var request2 = new XMLHttpRequest();
-
-      //Logout. Tell the server not to return the "WWW-Authenticate" header
-        request1.open("GET", logoutURL + "?prompt=false", true);
-        request1.send("");
-        request1.onreadystatechange = function(){
-            if (request1.readyState == 4) {
-
-              //Login with dummy credentials to clear the auth cache
-                request2.open("GET", logoutURL, true, "logout", "logout");
-                request2.send("");
-
-                request2.onreadystatechange = function(){
-                    if (request2.readyState == 4) {
-                        if (callback!=null) callback.call();
-                    }
-                }
-            }
-        }
-    }
-    else {
-        var request = ((window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"));
-        request.open("GET", logoutURL, true, "logout", "logout");
-        request.send("");
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/15ae0d78/gateway-release/home/conf/topologies/knoxsso.xml
----------------------------------------------------------------------
diff --git a/gateway-release/home/conf/topologies/knoxsso.xml b/gateway-release/home/conf/topologies/knoxsso.xml
index 869da4e..56700dd 100644
--- a/gateway-release/home/conf/topologies/knoxsso.xml
+++ b/gateway-release/home/conf/topologies/knoxsso.xml
@@ -109,15 +109,15 @@
         <role>KNOXSSO</role>
         <param>
             <name>knoxsso.cookie.secure.only</name>
-            <value>false</value>
+            <value>true</value>
         </param>
         <param>
             <name>knoxsso.token.ttl</name>
-            <value>36000000</value>
+            <value>-1</value>
         </param>
         <param>
            <name>knoxsso.redirect.whitelist.regex</name>
-           <value>^https?:\/\/(www\.local\.com|localhost|127\.0\.0\.1|0:0:0:0:0:0:0:1|::1):[0-9].*$</value>
+           <value>^https?:\/\/(localhost|127\.0\.0\.1|0:0:0:0:0:0:0:1|::1):[0-9].*$</value>
         </param>
     </service>
 


Mime
View raw message