|
|
|
@ -34,8 +34,8 @@ function onRequest(context) {
|
|
|
|
|
var deviceParam = "{\"scope\":\"stats\",\"deviceIdentifiers\":[{\"id\":\"" + device.deviceIdentifier
|
|
|
|
|
+ "\", \"type\":\"" + device.type + "\"}]}";
|
|
|
|
|
var encodedScope = tokenUtil.encode(deviceParam);
|
|
|
|
|
var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username,
|
|
|
|
|
"{\"device\": \"" + encodedScope + "\"}");
|
|
|
|
|
var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username,"default",
|
|
|
|
|
{"device": encodedScope});
|
|
|
|
|
var token = "";
|
|
|
|
|
if (tokenPair) {
|
|
|
|
|
token = tokenPair.accessToken;
|
|
|
|
|