Using AAA based basic Auth 13/10513/2
authorHarman Singh <harmasin@cisco.com>
Fri, 29 Aug 2014 23:06:37 +0000 (16:06 -0700)
committerHarman Singh <harmasin@cisco.com>
Tue, 2 Sep 2014 16:58:32 +0000 (09:58 -0700)
AAA has added basic auth for RestConf, we will be using that in dlux
Eventually, once token based authentication has Rest API, we will use those of AAA

Change-Id: I94bf4b75188d8a82cfe3910be77a509029cfdde7
Signed-off-by: Harman Singh <harmasin@cisco.com>
dlux-web/src/common/authentification/auth.services.js

index aa082921a2ef7a7d45b6c929eb7cf99a5e6062ce..717804155252c10c22323589e35b71d01028ea71 100644 (file)
@@ -54,7 +54,7 @@ define(['common/authentification/auth.module'], function(auth) {
           };*/
           factory.login = function (user, pw, cb, eb) {
               factory.setBasic(user, pw);
-              $http.get(ENV.baseURL + "/controller/nb/v2/flowprogrammer/default")
+              $http.get(ENV.baseURL + "/restconf/operational/network-topology:network-topology")
                   .success(function (data, status, headers, config) {
                     cb(data);
                   })
@@ -159,7 +159,8 @@ define(['common/authentification/auth.module'], function(auth) {
   auth.factory('NbInterceptor', function($q, $window, Base64) {
     return {
       request : function(config) {
-        if (config.url.indexOf('controller/nb/v2') != -1) {
+          // Use AAA basic authentication
+        if (config.url.indexOf('restconf') != -1 || config.url.indexOf('controller/nb/v2') != -1) {
           config.headers = config.headers || {};
           if ($window.sessionStorage.odlUser && $window.sessionStorage.odlPass) {
             var encoded = Base64.encode($window.sessionStorage.odlUser + ':' + $window.sessionStorage.odlPass);