Repository: ambari Updated Branches: refs/heads/trunk e66455398 -> cd9ed4623
Revert "AMBARI-12153. Ambari Web should automatically log the user in if valid HTTP authorization header is present (Single Sign On). (yusaku)" This reverts commit 0d5cb02de893bf27f1ada92e21f15b06131c759f. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cd9ed462 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cd9ed462 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cd9ed462 Branch: refs/heads/trunk Commit: cd9ed4623a5084984e61583ca9a0e1c28c9464d9 Parents: e664553 Author: Jaimin Jetly <jai...@hortonworks.com> Authored: Sat Jun 27 13:24:09 2015 -0700 Committer: Jaimin Jetly <jai...@hortonworks.com> Committed: Sat Jun 27 13:34:28 2015 -0700 ---------------------------------------------------------------------- ambari-web/app/router.js | 53 +++++++++++++------------------------------ 1 file changed, 16 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/cd9ed462/ambari-web/app/router.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js index 38dae93..9ea8f54 100644 --- a/ambari-web/app/router.js +++ b/ambari-web/app/router.js @@ -132,48 +132,27 @@ App.Router = Em.Router.extend({ var dfd = $.Deferred(); var self = this; var auth = App.db.getAuthenticated(); - App.ajax.send({ - name: 'router.login.clusters', - sender: this, - success: 'onAuthenticationSuccess', - error: 'onAuthenticationError' - }).complete(function (xhr) { - if (xhr.isResolved()) { - // if server knows the user and user authenticated by UI - if (auth && auth === true) { + var authResp = (auth && auth === true); + if (authResp) { + App.ajax.send({ + name: 'router.login.clusters', + sender: this, + success: 'onAuthenticationSuccess', + error: 'onAuthenticationError' + }).complete(function () { dfd.resolve(self.get('loggedIn')); - // if server knows the user but UI don't, check the response header - // and try to authorize - } else if (xhr.getResponseHeader('User')) { - var user = xhr.getResponseHeader('User'); - App.ajax.send({ - name: 'router.login', - sender: self, - data: { - usr: user, - loginName: encodeURIComponent(user) - }, - success: 'loginSuccessCallback', - error: 'loginErrorCallback' - }); - } else { - self.setAuthenticated(false); - dfd.resolve(false); - } - } else { - self.setAuthenticated(false); - dfd.resolve(false); - } - }); + }); + } else { + this.set('loggedIn', false); + dfd.resolve(false); + } return dfd.promise(); }, onAuthenticationSuccess: function (data) { - if (App.db.getAuthenticated() === true) { - this.setAuthenticated(true); - if (data.items.length) { - this.setClusterInstalled(data); - } + this.setAuthenticated(true); + if (data.items.length) { + this.setClusterInstalled(data); } },