|
|
@ -42,7 +42,7 @@ function onRequest(context) {
|
|
|
|
if (tokenPair) {
|
|
|
|
if (tokenPair) {
|
|
|
|
token = tokenPair.accessToken;
|
|
|
|
token = tokenPair.accessToken;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
websocketEndpoint = websocketEndpoint + "/secured-websocket/iot.per.device.stream.virtualfirealarm.temperature/1.0.0?"
|
|
|
|
websocketEndpoint = websocketEndpoint + "/secured-websocket-proxy/iot.per.device.stream.virtualfirealarm.temperature/1.0.0?"
|
|
|
|
+ "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
|
|
|
+ "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + user.domain
|
|
|
|
var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + user.domain
|
|
|
@ -50,7 +50,7 @@ function onRequest(context) {
|
|
|
|
if (tokenPair) {
|
|
|
|
if (tokenPair) {
|
|
|
|
token = tokenPair.accessToken;
|
|
|
|
token = tokenPair.accessToken;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
websocketEndpoint = websocketEndpoint + "/secured-websocket/t/" + user.domain + "/iot.per.device.stream.virtualfirealarm.temperature/1.0.0?"
|
|
|
|
websocketEndpoint = websocketEndpoint + "/secured-websocket-proxy/t/" + user.domain + "/iot.per.device.stream.virtualfirealarm.temperature/1.0.0?"
|
|
|
|
+ "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
|
|
|
+ "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|