From b86be8375c67b9a25465e92e890b634e93dc1963 Mon Sep 17 00:00:00 2001 From: dilanua Date: Fri, 29 Jul 2016 15:41:43 +0530 Subject: [PATCH] Refactoring OAuth utilities at UI Layer --- .../devicemgt/app/modules/token-handlers.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/token-handlers.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/token-handlers.js index 5d1097a2ec3..097732c059f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/token-handlers.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/token-handlers.js @@ -32,30 +32,30 @@ var handlers = function () { var privateMethods = {}; var publicMethods = {}; - privateMethods.setUpEncodedTenantBasedClientCredentials = function (username) { + privateMethods.setUpEncodedTenantBasedClientAppCredentials = function (username) { if (!username) { throw new Error("{/app/modules/token-handlers.js} Could not set up encoded tenant based " + "client credentials to session context. No username is found as " + - "input - setUpEncodedTenantBasedClientCredentials(x)"); + "input - setUpEncodedTenantBasedClientAppCredentials(x)"); } else { var dynamicClientAppCredentials = tokenUtil.getDynamicClientAppCredentials(); if (!dynamicClientAppCredentials) { throw new Error("{/app/modules/token-handlers.js} Could not set up encoded tenant based " + "client credentials to session context as the server is unable to obtain " + - "dynamic client credentials - setUpEncodedTenantBasedClientCredentials(x)"); + "dynamic client credentials - setUpEncodedTenantBasedClientAppCredentials(x)"); } else { var jwtToken = tokenUtil.getAccessTokenByJWTGrantType(dynamicClientAppCredentials); if (!jwtToken) { throw new Error("{/app/modules/token-handlers.js} Could not set up encoded tenant based " + "client credentials to session context as the server is unable to obtain " + - "a jwt token - setUpEncodedTenantBasedClientCredentials(x)"); + "a jwt token - setUpEncodedTenantBasedClientAppCredentials(x)"); } else { var tenantBasedClientCredentials = tokenUtil. getTenantBasedClientAppCredentials(username, jwtToken); if (!tenantBasedClientCredentials) { throw new Error("{/app/modules/token-handlers.js} Could not set up encoded tenant " + "based client credentials to session context as the server is unable " + - "to obtain such credentials - setUpEncodedTenantBasedClientCredentials(x)"); + "to obtain such credentials - setUpEncodedTenantBasedClientAppCredentials(x)"); } else { var encodedTenantBasedClientCredentials = tokenUtil.encode(tenantBasedClientCredentials["clientId"] + ":" + @@ -74,7 +74,7 @@ var handlers = function () { "password grant type. Either username, password or both are missing as " + "input - setupAccessTokenPairByPasswordGrantType(x, y)"); } else { - privateMethods.setUpEncodedTenantBasedClientCredentials(username); + privateMethods.setUpEncodedTenantBasedClientAppCredentials(username); var encodedClientCredentials = session.get(constants["ENCODED_CLIENT_KEYS_IDENTIFIER"]); if (!encodedClientCredentials) { throw new Error("{/app/modules/token-handlers.js} Could not set up access token pair by " + @@ -109,7 +109,7 @@ var handlers = function () { "saml grant type. Either username, samlToken or both are missing as " + "input - setupAccessTokenPairByPasswordGrantType(x, y)"); } else { - privateMethods.setUpEncodedTenantBasedClientCredentials(username); + privateMethods.setUpEncodedTenantBasedClientAppCredentials(username); var encodedClientCredentials = session.get(constants["ENCODED_CLIENT_KEYS_IDENTIFIER"]); if (!encodedClientCredentials) { throw new Error("{/app/modules/token-handlers.js} Could not set up access token pair " +