You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2016/03/21 18:34:26 UTC

ambari git commit: AMBARI-15319. In IE, logging out of Ambari Admin View doesn't log user out of web console. (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk ada7f51b2 -> aa8409fd1


AMBARI-15319. In IE, logging out of Ambari Admin View doesn't log user out of web console. (alexantonenko)


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

Branch: refs/heads/trunk
Commit: aa8409fd1e6cbef664766f9ffba45be6c2284b2e
Parents: ada7f51
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Mar 21 19:34:11 2016 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Mar 21 19:34:22 2016 +0200

----------------------------------------------------------------------
 .../resources/ui/admin-web/app/scripts/services/Auth.js  | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/aa8409fd/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Auth.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Auth.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Auth.js
index 14c04c1..ca5d879 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Auth.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Auth.js
@@ -18,7 +18,7 @@
 'use strict';
 
 angular.module('ambariAdminConsole')
-.factory('Auth',['$http', 'Settings', '$window', function($http, Settings, $window) {
+.factory('Auth',['$http', 'Settings', function($http, Settings) {
   var ambari;
   var currentUserName;
   if (localStorage.ambari) {
@@ -35,11 +35,18 @@ angular.module('ambariAdminConsole')
       delete data.app.user;
       localStorage.ambari = JSON.stringify(data);
       // Workaround for sign off within Basic Authorization
-      var origin = $window.location.protocol + '//' + Date.now() + ':' + Date.now() + '@' +
+      //commenting this out since using Date.now() in the url causes a security error in IE and does not log out user
+      /*var origin = $window.location.protocol + '//' + Date.now() + ':' + Date.now() + '@' +
             $window.location.hostname + ($window.location.port ? ':' + $window.location.port : '');
       return $http({
         method: 'GET',
         url: origin + Settings.baseUrl + '/logout'
+      });*/
+      //use an invalid username and password in the request header
+      $http.defaults.headers.common['Authorization'] = 'Basic ' + btoa('invalid_username:password');
+      return $http({
+        method: 'GET',
+        url: Settings.baseUrl + '/logout'
       });
     },
     getCurrentUser: function() {