From 6e69fc8e8447820b0df84759f8b564f78bac758d Mon Sep 17 00:00:00 2001 From: GPrathap Date: Mon, 5 Dec 2016 09:48:26 +0530 Subject: [PATCH] changed application creation endpoint --- .../devicemgt/app/modules/oauth/token-handler-utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 50cdb7f76f..81cdc1729b 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 @@ -167,14 +167,14 @@ var utils = function () { // register a tenant based app at API Manager var applicationName = "websocket_webapp_" + tenantDomain; - var requestURL = deviceMgtProps["oauthProvider"]["appRegistration"] - ["apiManagerClientAppRegistrationServiceURL"] + - "?tenantDomain=" + tenantDomain + "&applicationName=" + applicationName; + var requestURL = (deviceMgtProps["oauthProvider"]["appRegistration"] + ["apiManagerClientAppRegistrationServiceURL"]).replace("/tenants",""); var xhr = new XMLHttpRequest(); xhr.open("POST", requestURL, false); xhr.setRequestHeader("Content-Type", "application/json"); xhr.setRequestHeader("X-JWT-Assertion", "" + jwtToken); - xhr.send(); + xhr.send(stringify({applicationName:applicationName, tags:["device_management"], + isAllowedToAllDomains:false, isMappingAnExistingOAuthApp:false, validityPeriod: 3600})); if (xhr["status"] == 201 && xhr["responseText"]) { var responsePayload = parse(xhr["responseText"]); var tenantTenantBasedWebsocketClientAppCredentials = {};