From e8eb0123c7b44cad0f686d9ca772dceb1c6e910f Mon Sep 17 00:00:00 2001 From: Megala Date: Mon, 3 Oct 2016 14:18:43 +0530 Subject: [PATCH] Fixing the tenant loading problem when sso is enabled --- .../resources/jaggeryapps/devicemgt/app/modules/login.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js index d36e7af0ab..612d0d41dd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js @@ -35,6 +35,11 @@ var onFail; if (!context.input.samlToken) { (new carbonServer.Server({url: devicemgtProps["adminService"]})) .login(context.input.username, context.input.password); + } else { + var PrivilegedCarbonContext = Packages.org.wso2.carbon.context.PrivilegedCarbonContext; + PrivilegedCarbonContext.startTenantFlow(); + var cxt = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + cxt.setTenantDomain(context.user.domain, true); } };