From bbff93adcc13599b1a406c82392aa355f1f1e5e4 Mon Sep 17 00:00:00 2001 From: dilanua Date: Mon, 1 Aug 2016 18:50:47 +0530 Subject: [PATCH] Updating token-handler-utils with suppressed warnings for java packg imports --- .../app/modules/oauth/token-handler-utils.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handler-utils.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handler-utils.js index 1ed0291e378..dc2655233fa 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handler-utils.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handler-utils.js @@ -19,22 +19,26 @@ var utils = function () { var log = new Log("/app/modules/oauth/token-handler-utils.js"); - var deviceMgtProps = require("/app/conf/reader/main.js")["conf"]; + var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var constants = require("/app/modules/constants.js"); var carbon = require("carbon"); + //noinspection JSUnresolvedVariable var Base64 = Packages.org.apache.commons.codec.binary.Base64; + //noinspection JSUnresolvedVariable var String = Packages.java.lang.String; var publicMethods = {}; var privateMethods = {}; publicMethods.encode = function (payload) { - return new String(Base64.encodeBase64(new String(payload).getBytes())); + //noinspection JSUnresolvedFunction + return String(Base64.encodeBase64(String(payload).getBytes())); }; publicMethods.decode = function (payload) { - return new String(Base64.decodeBase64(new String(payload).getBytes())); + //noinspection JSUnresolvedFunction + return String(Base64.decodeBase64(String(payload).getBytes())); }; publicMethods.getDynamicClientAppCredentials = function () { @@ -117,8 +121,8 @@ var utils = function () { } else { var assertionXML = publicMethods.decode(assertion); /* - TODO: make assertion extraction with proper parsing. Since Jaggery XML parser seem - to add formatting which causes signature verification to fail. + TODO: make assertion extraction with proper parsing. + Since Jaggery XML parser seem to add formatting which causes signature verification to fail. */ var assertionStartMarker = "