From adc3b652bf601f7b61b6e8883413fbcba972854f Mon Sep 17 00:00:00 2001 From: manoj Date: Fri, 13 Nov 2015 18:57:45 +0530 Subject: [PATCH] Add authentication method boolean check. Android allows user level authentication. IOS and windows allow device authetication. This is a temporary fix until fix windows and IOS certifcate level user extraction --- .../mgt/core/DeviceManagementPluginRepository.java | 2 +- .../mgt/core/internal/DeviceManagementDataHolder.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java index ae94f52811..351d6fa2ae 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementPluginRepository.java @@ -41,7 +41,7 @@ public class DeviceManagementPluginRepository implements DeviceManagerStartupLis } public void addDeviceManagementProvider(DeviceManagementService provider) throws DeviceManagementException { - String deviceType = provider.getType(); + String deviceType = provider.getType(); synchronized (providers) { try { if (isInited) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementDataHolder.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementDataHolder.java index d59962a619..25255df402 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementDataHolder.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementDataHolder.java @@ -29,6 +29,8 @@ import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.user.core.tenant.TenantManager; import org.wso2.carbon.utils.ConfigurationContextService; +import java.util.HashMap; + public class DeviceManagementDataHolder { private RealmService realmService; @@ -41,6 +43,7 @@ public class DeviceManagementDataHolder { private AppManagementConfig appManagerConfig; private OperationManager operationManager; private ConfigurationContextService configurationContextService; + private HashMap isUserLevelAutherizationAllowMap; private static DeviceManagementDataHolder thisInstance = new DeviceManagementDataHolder(); @@ -143,4 +146,11 @@ public class DeviceManagementDataHolder { this.configurationContextService = configurationContextService; } + public void setIsUserLevelAutherizationAllow(String pluginType, boolean isAllowUserAuthentication) { + isUserLevelAutherizationAllowMap.put(pluginType,isAllowUserAuthentication); + } + + public boolean getIsUserLevelAutherizationAllow(String pluginType) { + return isUserLevelAutherizationAllowMap.get(pluginType); + } }