summaryrefslogtreecommitdiffstats
path: root/src/main/resources/META-INF
diff options
context:
space:
mode:
authorxg353y <xg353y@intl.att.com>2018-05-08 16:21:39 +0200
committerSébastien Determe <sd378r@intl.att.com>2018-06-11 12:29:28 +0000
commite640955cbe2c2c39aaa897476ceaac156072133f (patch)
treeb0e793d158ea00485213fba82fbbbeef1331a59b /src/main/resources/META-INF
parent2c0ec04d5978a0eaf9b13d9830d0398e8aed0e66 (diff)
Integrate AAF
Integrate AAF framework into Clamp. Issue-ID: CLAMP-103 Change-Id: I2ceeb2a85b8b5674e712b3924a96a2bd6fb71d68 Signed-off-by: xg353y <xg353y@intl.att.com>
Diffstat (limited to 'src/main/resources/META-INF')
-rw-r--r--src/main/resources/META-INF/resources/designer/authenticate.html12
-rw-r--r--src/main/resources/META-INF/resources/designer/invalid_login.html7
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/authcontroller.js40
3 files changed, 13 insertions, 46 deletions
diff --git a/src/main/resources/META-INF/resources/designer/authenticate.html b/src/main/resources/META-INF/resources/designer/authenticate.html
index a6c2cb8da..5429dced8 100644
--- a/src/main/resources/META-INF/resources/designer/authenticate.html
+++ b/src/main/resources/META-INF/resources/designer/authenticate.html
@@ -18,7 +18,6 @@
limitations under the License.
============LICENSE_END============================================
===================================================================
-
-->
<style>
.divRow {
@@ -41,20 +40,13 @@
<head>
<title>CLDS</title>
</head>
-<div ng-controller="AuthenticateCtrl">
+<div ng-controller="AuthenticateCtrl" ng-init="authenticate()">
<div id='head'>
<div ng-include="'menu_simplified.html'"></div>
</div>
<div id='main'>
- <div class="divRow"><b>Welcome to Clamp. Please login first.</b></div>
- <div class="divForm">
- <form ng-submit="authenticate()" method="post" autocomplete="off">
- <div class="divFormRow"><label>User Name : <input type="text" ng-model="username" name="username"/> </label></div>
- <div class="divFormRow"><label>Password: <input type="password" ng-model="password" name="password"/> </label></div>
- <div class="divFormRow"><input type="submit" value=" Sign In"/></div>
- </form>
- </div>
+ <div class="divRow"><b>Welcome to Clamp.</b></div>
</div>
</div>
diff --git a/src/main/resources/META-INF/resources/designer/invalid_login.html b/src/main/resources/META-INF/resources/designer/invalid_login.html
index f42be51ec..5d6e955b7 100644
--- a/src/main/resources/META-INF/resources/designer/invalid_login.html
+++ b/src/main/resources/META-INF/resources/designer/invalid_login.html
@@ -34,12 +34,7 @@
</head>
<div>
<div class="divRow"><b>Login Failed!</b></div>
- <div class="divRow"><b>Please make sure your login and password are correct.
- If you don't have the login credential, please contact CLAMP administrator.</b></div>
+ <div class="divRow"><b>You are not authorized to access CLAMP UI, please contact CLAMP administrator.</b></div>
<div class="divRow">To login again, please click <a href="/designer/index.html"/>Login</a></div>
</div>
-
-
-
-
diff --git a/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js b/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
index ac8919801..c1a52f9b1 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
@@ -18,7 +18,7 @@
* limitations under the License.
* ============LICENSE_END============================================
* ===================================================================
- *
+ *
*/
'use strict';
@@ -27,47 +27,27 @@ function AuthenticateCtrl($scope, $rootScope, $window, $resource, $http, $locati
console.log("//////////AuthenticateCtrl");
$scope.getInclude = function() {
console.log("getInclude011111111");
- var invalidUser = $window.localStorage.getItem("isInvalidUser");
+ var invalidUser = $window.localStorage.getItem("invalidUser");
var isAuth = $window.localStorage.getItem("isAuth");
-
- if (invalidUser != null && invalidUser == 'true') {
- console.log("Authentication failed");
- $window.localStorage.removeItem("isInvalidUser");
- window.location.href = "/designer/invalid_login.html";
- } else if (isAuth == null || isAuth == 'false') {
+ if (invalidUser == 'true')
+ return "invalid_login.html";
+ else if (isAuth == null || isAuth == 'false') {
return "authenticate.html";
}
- // Reassign the login user info, to be used in menu.html
- $rootScope.loginuser = $window.localStorage.getItem("loginuser");
return "utmdashboard.html";
};
$scope.authenticate = function() {
- var username = $scope.username;
- var pass = $scope.password;
- if (!username || !pass) {
- console.log("Invalid username/password");
- $window.localStorage.setItem("isInvalidUser", true);
- return;
- }
- var headers = username ? {
- authorization: "Basic " +
- btoa(username + ":" + pass)
- } : {};
- // send request to a test API with the username/password to verify the authorization
- $http.get('/restservices/clds/v1/user/testUser', {
- headers: headers
+ // send request to a test API for authentication/authorization check
+ $http.get('/restservices/clds/v1/user/getUser', {
}).success(function(data) {
if (data) {
$window.localStorage.setItem("isAuth", true);
- $window.localStorage.setItem("loginuser", $scope.username);
- $rootScope.loginuser = $scope.username;
- } else {
- $window.localStorage.removeItem("isInvalidUser", true);
- }
+ $rootScope.loginuser = data;
+ }
callback && callback();
}).error(function() {
- $window.localStorage.removeItem("isInvalidUser", true);
+ $window.localStorage.setItem("invalidUser", true);
callback && callback();
});
};