From 838223c67ad743a2863d290de04460994d160dd1 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Wed, 4 Jan 2017 00:18:28 +0530 Subject: [PATCH 1/3] Removed unneccesary configs --- .../android-web-agent/app/conf/config.json | 11 ----------- .../windows-web-agent/app/conf/config.json | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json index 75943b23b..2b5eb8a4f 100755 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json @@ -1,6 +1,5 @@ { "appContext" : "/android-web-agent/", - "apiContext" : "api", "httpsURL" : "%https.ip%", "httpURL" : "%http.ip%", "enrollmentDir": "/android-web-agent/enrollment", @@ -35,16 +34,6 @@ }, "androidAgentApp" : "android-agent.apk", "windowsConfigRoot" : "%http.ip%/api/device-mgt/windows/v1.0/services/federated/bst/authentication", - "ssoConfiguration" : { - "enabled" : false, - "issuer" : "mdm", - "appName" : "admin_android-web-agent", - "identityProviderURL" : "%https.ip%/sso/samlsso.jag", - "responseSigningEnabled" : "true", - "keyStorePassword" : "wso2carbon", - "identityAlias" : "wso2carbon", - "keyStoreName" : "/repository/resources/security/wso2carbon.jks" - }, "generalConfig" : { "host" : "%http.ip%", "companyName" : "WSO2 Enterprise Mobility Manager", diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json index d02ddd740..848d467bf 100755 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json @@ -1,6 +1,5 @@ { "appContext" : "/windows-web-agent/", - "apiContext" : "api", "httpsURL" : "%https.ip%", "httpURL" : "%http.ip%", "enrollmentDir": "/windows-web-agent/enrollment", @@ -35,16 +34,6 @@ }, "androidAgentApp" : "android-agent.apk", "windowsConfigRoot" : "%http.ip%/api/device-mgt/windows/v1.0/federated/bst/authentication", - "ssoConfiguration" : { - "enabled" : false, - "issuer" : "mdm", - "appName" : "admin_windows-web-agent", - "identityProviderURL" : "%https.ip%/sso/samlsso.jag", - "responseSigningEnabled" : "true", - "keyStorePassword" : "wso2carbon", - "identityAlias" : "wso2carbon", - "keyStoreName" : "/repository/resources/security/wso2carbon.jks" - }, "generalConfig" : { "host" : "%http.ip%", "companyName" : "WSO2 Enterprise Mobility Manager", From 2550096cea810dd4d304f0afc089f5dde7a45371 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Wed, 4 Jan 2017 22:15:01 +0530 Subject: [PATCH 2/3] config.json [apimgt-gateway] renamed to [gatewayEnabled] --- .../windows-web-agent/app/modules/oauth/token-handlers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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-handlers.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-handlers.js index bff0f143f..f18f4c235 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-handlers.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-handlers.js @@ -142,7 +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"]) { + if (devicemgtProps["gatewayEnabled"]) { var jwtToken = tokenUtil.getAccessTokenByJWTGrantType(dynamicClientAppCredentials); if (!jwtToken) { throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up encoded tenant based " + From f3588c7951332bf2470fc67811a07d1d6e6c267d Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Wed, 4 Jan 2017 22:28:12 +0530 Subject: [PATCH 3/3] config.json [usernameLength] moved to [userValidationConfig][usernameLength] --- .../jaggeryapps/android-web-agent/api/user-api.jag | 6 +++--- .../jaggeryapps/android-web-agent/app/conf/config.json | 4 +++- .../jaggeryapps/windows-web-agent/api/user-api.jag | 6 +++--- .../jaggeryapps/windows-web-agent/app/conf/config.json | 4 +++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/api/user-api.jag b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/api/user-api.jag index b038e66ad..2a36433de 100755 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/api/user-api.jag +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/api/user-api.jag @@ -121,9 +121,9 @@ if (uriMatcher.match("/{context}/api/user/authenticate")) { } else { userRoles = String(addUserFormData.userRoles).split(","); } - if (username.length < devicemgtProps.usernameLength) { - log.error("Username Must be between 1 and " + devicemgtProps.usernameLength + " characters long"); - result = "Username Must be between 1 and " + devicemgtProps.usernameLength + " characters long"; + if (username.length < devicemgtProps.userValidationConfig.usernameLength) { + log.error("Username Must be between 1 and " + devicemgtProps.userValidationConfig.usernameLength + " characters long"); + result = "Username Must be between 1 and " + devicemgtProps.userValidationConfig.usernameLength + " characters long"; } else { try { result = userModule.addUser(username, firstname, lastname, emailAddress, userRoles); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json index 2b5eb8a4f..3c8202705 100755 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json @@ -23,7 +23,9 @@ "tokenServiceURL": "%https.ip%/oauth2/token" }, "adminUser":"admin", - "usernameLength":30, + "userValidationConfig" : { + "usernameLength":30 + }, "device" : { "ios" : { "location" : "%http.ip%/android-web-agent/public/mdm.page.enrollments.ios.download-agent/asset/ios-agent.ipa", diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/api/user-api.jag b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/api/user-api.jag index b038e66ad..2a36433de 100755 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/api/user-api.jag +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/api/user-api.jag @@ -121,9 +121,9 @@ if (uriMatcher.match("/{context}/api/user/authenticate")) { } else { userRoles = String(addUserFormData.userRoles).split(","); } - if (username.length < devicemgtProps.usernameLength) { - log.error("Username Must be between 1 and " + devicemgtProps.usernameLength + " characters long"); - result = "Username Must be between 1 and " + devicemgtProps.usernameLength + " characters long"; + if (username.length < devicemgtProps.userValidationConfig.usernameLength) { + log.error("Username Must be between 1 and " + devicemgtProps.userValidationConfig.usernameLength + " characters long"); + result = "Username Must be between 1 and " + devicemgtProps.userValidationConfig.usernameLength + " characters long"; } else { try { result = userModule.addUser(username, firstname, lastname, emailAddress, userRoles); diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json index 848d467bf..7e4a733cd 100755 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json @@ -23,7 +23,9 @@ "tokenServiceURL": "%https.ip%/oauth2/token" }, "adminUser":"admin", - "usernameLength":30, + "userValidationConfig": { + "usernameLength":30 + }, "device" : { "ios" : { "location" : "%http.ip%/windows-web-agent/public/mdm.page.enrollments.ios.download-agent/asset/ios-agent.ipa",