From 10e7eac929db9460dca63a35b7ef8510441c8698 Mon Sep 17 00:00:00 2001 From: Hasunie Date: Thu, 20 Jul 2017 10:14:46 +0530 Subject: [PATCH] configuring to windows enrollment to support tenants --- .../api/services/discovery/impl/DiscoveryServiceImpl.java | 3 +-- .../windows-web-agent/app/modules/oauth/token-handler-utils.js | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/discovery/impl/DiscoveryServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/discovery/impl/DiscoveryServiceImpl.java index 93337f0a2c..0ca461f73b 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/discovery/impl/DiscoveryServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/discovery/impl/DiscoveryServiceImpl.java @@ -49,7 +49,6 @@ public class DiscoveryServiceImpl implements DiscoveryService { public static final String FEDERATED = "Federated"; private static final String DELIMITER = "@"; - private static final int DOMAIN_SEGMENT = 1; private static Log log = LogFactory.getLog( org.wso2.carbon.device.mgt.mobile.windows.api.services.discovery.impl.DiscoveryServiceImpl.class); @@ -67,7 +66,7 @@ public class DiscoveryServiceImpl implements DiscoveryService { String emailId = discoveryRequest.getEmailId(); String[] userDomains = emailId.split(DELIMITER); - String domain = userDomains[DOMAIN_SEGMENT]; + String domain = userDomains[(userDomains.length)-1]; DiscoveryResponse discoveryResponse; if (!PluginConstants.WindowsVersionProperties.REQUESTED_WIN81_VERSION.equals(discoveryRequest.getVersion()) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/modules/oauth/token-handler-utils.js b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/modules/oauth/token-handler-utils.js index 9f21470cf7..5aa1b1120b 100755 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/modules/oauth/token-handler-utils.js +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/modules/oauth/token-handler-utils.js @@ -42,6 +42,8 @@ var utils = function () { }; publicMethods["getDynamicClientAppCredentials"] = function (username, password) { + log.error("username"+ username); + log.error("password"+password); // setting up dynamic client application properties var dcAppProperties = { "applicationName": deviceMgtProps["oauthProvider"]["appRegistration"]["applicationName"],