Supporting authentication to WebSocket for GUI2
Change-Id: Id62f60760341b39399912b0fc4f6046c6e616bb0
diff --git a/web/gui2/src/main/webapp/app/fw/remote/websocket.service.ts b/web/gui2/src/main/webapp/app/fw/remote/websocket.service.ts
index b5eeaa6..42eb42e 100644
--- a/web/gui2/src/main/webapp/app/fw/remote/websocket.service.ts
+++ b/web/gui2/src/main/webapp/app/fw/remote/websocket.service.ts
@@ -324,8 +324,9 @@
this.ws.onopen = (() => this.handleOpen());
this.ws.onmessage = ((msgEvent) => this.handleMessage(msgEvent));
this.ws.onclose = (() => this.handleClose());
-
- this.sendEvent('authentication token', { token: 'testAuth' });
+ const authToken = this.window['onosAuth'];
+ this.log.debug('Auth Token for opening WebSocket', authToken);
+ this.sendEvent('authentication', { token: authToken });
}
// Note: Wsock logs an error if the new WebSocket call fails
return this.url;