mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
fixing windows enrollment flow
This commit is contained in:
parent
0fd317d027
commit
35ba0b2a9b
@ -27,6 +27,11 @@
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<baseDirectory>${basedir}/src</baseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${basedir}/src/main/resources/jaggeryapps/windows-web-agent</directory>
|
||||
<outputDirectory>/windows-web-agent</outputDirectory>
|
||||
<useDefaultExcludes>true</useDefaultExcludes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${basedir}/src/main/resources/jaggeryapps/devicemgt</directory>
|
||||
<outputDirectory>/devicemgt</outputDirectory>
|
||||
@ -37,10 +42,5 @@
|
||||
<outputDirectory>/windows-web-agent</outputDirectory>
|
||||
<useDefaultExcludes>true</useDefaultExcludes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${basedir}/src/main/resources/jaggeryapps/windows-web-agent</directory>
|
||||
<outputDirectory>/windows-web-agent</outputDirectory>
|
||||
<useDefaultExcludes>true</useDefaultExcludes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@ -312,7 +312,7 @@ deviceModule = function () {
|
||||
var url;
|
||||
var license;
|
||||
if (deviceType == "windows") {
|
||||
url = devicemgtProps["httpURL"] + "/mdm-windows-agent/services/device/license";
|
||||
url = devicemgtProps["httpURL"] + "/api/device-mgt/windows/v1.0/services/configuration/license";
|
||||
} else if (deviceType == "ios") {
|
||||
url = devicemgtProps["httpsURL"] + "/ios-enrollment/license/";
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ if (platform != "Windows Phone") {
|
||||
var status = restAPIResponse["status"];
|
||||
if (status == 200) {
|
||||
session.put("authenticatedUser", username);
|
||||
session.put("windowsBinaryToken", parse(xmlHttpRequest["responseText"]).UserToken);
|
||||
session.put("windowsBinaryToken", parse(restAPIResponse["responseText"]).UserToken);
|
||||
response.sendRedirect(mdmProps["appContext"] + "enrollments/windows/license-agent");
|
||||
} else if (status == 403) {
|
||||
response.sendRedirect(mdmProps["appContext"] + "enrollments/windows/login-agent?error=auth-failed");
|
||||
|
||||
@ -36,10 +36,10 @@ if (platform != "Windows Phone") {
|
||||
if (!authenticatedUser) {
|
||||
response.sendRedirect(mdmProps["appContext"] + "enrollments/error/unintentional-request");
|
||||
} else {
|
||||
var enrollmentUtils = require("/modules/enrollments/util/utils.js")["methods"];
|
||||
var Handlebars = require("/lib/handlebars-v2.0.0.js")["Handlebars"];
|
||||
var enrollmentUtils = require("/app/modules/enrollments/util/utils.js")["methods"];
|
||||
var Handlebars = require("/lib/modules/handlebars/handlebars-v2.0.0.js")["Handlebars"];
|
||||
var template = Handlebars.compile(enrollmentUtils.
|
||||
getResource("/modules/enrollments/windows/config/workplace-switch-request-template.hbs"));
|
||||
getResource("/app/modules/enrollments/windows/config/workplace-switch-request-template.hbs"));
|
||||
|
||||
var windowsWorkplaceAppID = session.get("windowsWorkplaceAppID");
|
||||
var windowsBinaryToken = session.get("windowsBinaryToken");
|
||||
|
||||
@ -142,6 +142,7 @@ var handlers = function () {
|
||||
"client credentials to session context as the server is unable to obtain " +
|
||||
"dynamic client credentials - setUpEncodedTenantBasedClientAppCredentials(x)");
|
||||
} else {
|
||||
if (devicemgtProps["apimgt-gateway"]) {
|
||||
var jwtToken = tokenUtil.getAccessTokenByJWTGrantType(dynamicClientAppCredentials);
|
||||
if (!jwtToken) {
|
||||
throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up encoded tenant based " +
|
||||
@ -163,6 +164,14 @@ var handlers = function () {
|
||||
encodedTenantBasedClientAppCredentials);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var encodedTenantBasedClientAppCredentials =
|
||||
tokenUtil.encode(dynamicClientAppCredentials["clientId"] + ":" +
|
||||
dynamicClientAppCredentials["clientSecret"]);
|
||||
// setting up encoded tenant based client credentials to session context.
|
||||
session.put(constants["ENCODED_TENANT_BASED_CLIENT_APP_CREDENTIALS"],
|
||||
encodedTenantBasedClientAppCredentials);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
</jndiConfig>
|
||||
<definition type="RDBMS">
|
||||
<configuration>
|
||||
<url>jdbc:h2:repository/database/WindowsDM_DB;DB_CLOSE_ON_EXIT=FALSE
|
||||
<url>jdbc:h2:repository/database/WSO2MobileWindows_DB;DB_CLOSE_ON_EXIT=FALSE
|
||||
</url>
|
||||
<username>wso2carbon</username>
|
||||
<password>wso2carbon</password>
|
||||
|
||||
@ -19,17 +19,19 @@
|
||||
-->
|
||||
<DeviceTypeConfiguration name="windows">
|
||||
|
||||
<License>
|
||||
<DeviceDetails table-id="WIN_DEVICE"/>
|
||||
|
||||
<License>
|
||||
<Language>en_US</Language>
|
||||
<Version>1.0.0</Version>
|
||||
<Text>This is license text</Text>
|
||||
</License>
|
||||
</License>
|
||||
|
||||
<ProvisioningConfig>
|
||||
<ProvisioningConfig>
|
||||
<SharedWithAllTenants>false</SharedWithAllTenants>
|
||||
</ProvisioningConfig>
|
||||
</ProvisioningConfig>
|
||||
|
||||
<DataSource>
|
||||
<DataSource>
|
||||
<jndiConfig>
|
||||
<name>jdbc/MobileWindowsDM_DS</name>
|
||||
</jndiConfig>
|
||||
@ -37,7 +39,6 @@
|
||||
<Table name="WIN_DEVICE">
|
||||
<PrimaryKey>DEVICE_ID</PrimaryKey>
|
||||
<Attributes>
|
||||
<Attribute>DEVICE_ID</Attribute>
|
||||
<Attribute>CHANNEL_URI</Attribute>
|
||||
<Attribute>DEVICE_INFO</Attribute>
|
||||
<Attribute>IMEI</Attribute>
|
||||
@ -50,25 +51,64 @@
|
||||
<Attribute>SERIAL</Attribute>
|
||||
<Attribute>MAC_ADDRESS</Attribute>
|
||||
<Attribute>DEVICE_NAME</Attribute>
|
||||
<Attribute>OS_BUILD_DATE</Attribute>
|
||||
</Attributes>
|
||||
</Table>
|
||||
</tableConfig>
|
||||
</DataSource>
|
||||
</DataSource>
|
||||
|
||||
<Features>
|
||||
<Feature code="abc">
|
||||
<Name>abc</Name>
|
||||
<Description>this is a feature</Description>
|
||||
<Operation context="/bulb/{state}" method="PUT">
|
||||
<QueryParameters>
|
||||
<Parameter>deviceId</Parameter>
|
||||
</QueryParameters>
|
||||
<FormParameters>
|
||||
<Parameter>test</Parameter>
|
||||
</FormParameters>
|
||||
<Features>
|
||||
<Feature code="DEVICE_LOCK">
|
||||
<Name>Device Lock</Name>
|
||||
<Description>Lock the device</Description>
|
||||
<Operation context="windows/lock-devices" method="POST">
|
||||
</Operation>
|
||||
</Feature>
|
||||
</Features>
|
||||
<Feature code="DISENROLL">
|
||||
<Name>Device Lock</Name>
|
||||
<Description>Lock the device</Description>
|
||||
<Operation context="windows/disenroll-devices" method="POST">
|
||||
</Operation>
|
||||
</Feature>
|
||||
<Feature code="WIPE_DATA">
|
||||
<Name>Device Lock</Name>
|
||||
<Description>Lock the device</Description>
|
||||
<Operation context="windows/wipe-devices" method="POST">
|
||||
</Operation>
|
||||
</Feature>
|
||||
<Feature code="DEVICE_RING">
|
||||
<Name>Device Lock</Name>
|
||||
<Description>Lock the device</Description>
|
||||
<Operation context="windows/ring-devices" method="POST">
|
||||
</Operation>
|
||||
</Feature>
|
||||
<Feature code="LOCK_RESET">
|
||||
<Name>Device Lock</Name>
|
||||
<Description>Lock the device</Description>
|
||||
<Operation context="windows/lock-reset-devices" method="POST">
|
||||
</Operation>
|
||||
</Feature>
|
||||
<Feature code="PASSCODE_POLICY">
|
||||
<Name>Password Policy</Name>
|
||||
<Description>Set passcode policy</Description>
|
||||
<Operation context="" method="POST">
|
||||
</Operation>
|
||||
</Feature>
|
||||
<Feature code="CAMERA">
|
||||
<Name>Camera Enable/Disable</Name>
|
||||
<Description>Enable/Disable camera</Description>
|
||||
<Operation context="" method="POST">
|
||||
</Operation>
|
||||
</Feature>
|
||||
<Feature code="ENCRYPT_STORAGE">
|
||||
<Name>Encrypt Storage</Name>
|
||||
<Description>Encrypt the device storage</Description>
|
||||
<Operation context="" method="POST">
|
||||
</Operation>
|
||||
</Feature>
|
||||
</Features>
|
||||
|
||||
<DeviceAuthorizationConfig>
|
||||
<authorizationRequired>false</authorizationRequired>
|
||||
</DeviceAuthorizationConfig>
|
||||
|
||||
</DeviceTypeConfiguration>
|
||||
|
||||
@ -18,7 +18,12 @@ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../dep
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.policy-edit);\
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.policy-view);\
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.policy-wizard);\
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.qr-modal);\
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.type-view);\
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.leaflet);\
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-bar);\
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.operation-mod);\
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.date-range-picker);\
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/windows);\
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../database/WSO2MobileWindows_DB.h2.db);\
|
||||
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user