Authentication support for cdt
[appc/cdt.git] / src / app / admin / admin.component.ts
index 74fe86a..4bde5b5 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ============LICENSE_START==========================================
 ===================================================================
-Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
 ===================================================================
 
 Unless otherwise specified, all software contained herein is licensed
@@ -70,8 +70,8 @@ export class AdminComponent implements OnInit {
     }
 
     ngOnInit() {
-        const apiToken = localStorage['apiToken'];
-        this.currentUser = localStorage['userId'];
+        const apiToken = sessionStorage['apiToken'];
+        this.currentUser = sessionStorage['userId'];
 
         if(this.paramShareService.ansibleServerData) {
             this.ansibleServerData = this.paramShareService.ansibleServerData;
@@ -92,14 +92,14 @@ export class AdminComponent implements OnInit {
          const input = {
             "input":{
                 "design-request":{
-                    "request-id":localStorage['apiToken'],
+                    "request-id":sessionStorage['apiToken'],
                     "action":"getArtifact",
                     "payload":"{\"vnf-type\":\"NULL\",\"vnfc-type\":\"NULL\",\"protocol\":\"\",\"incart\":\"N\",\"action\":\"NULL\",\"artifact-name\":\""+this.fileName+"\",\"artifact-type\":\"APPC-CONFIG\",\"userID\":\"admin\"}"
                 }
             }
         };
         //const x = JSON.parse(data.input['design-request']['payload']);
-        //x.userID = localStorage['userId'];
+        //x.userID = sessionStorage['userId'];
         //data.input['design-request']['payload'] = JSON.stringify(x);
          console.log("input to payload====", JSON.stringify(input));
 
@@ -215,7 +215,7 @@ export class AdminComponent implements OnInit {
         let input = {
                 "input": {
                     "design-request": {
-                        "request-id": localStorage['apiToken'],
+                        "request-id": sessionStorage['apiToken'],
                         "action": "uploadAdminArtifact",
                         "payload": "{\"userID\": \"admin\",\"vnf-type\" : \"NULL \",\"action\" : \"NULL\",\"artifact-name\" : \""+this.fileName+"\",\"artifact-type\" : \"APPC-CONFIG\",\"artifact-version\" : \"0.1\",\"artifact-contents\":\""+artifactContent+"\"}",
                     }
@@ -244,4 +244,4 @@ export class AdminComponent implements OnInit {
         }
     }
 
-}
\ No newline at end of file
+}