diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/user-api.jag b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/user-api.jag index 7303a5ee8c..9d12aa9360 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/user-api.jag +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/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/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json index 6c11194110..e9e1d99ce6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json @@ -1,7 +1,5 @@ { "appContext": "/devicemgt/", - "webAgentContext" : "/emm-web-agent/", - "apiContext": "api", "httpsURL" : "%https.ip%", "httpURL" : "%http.ip%", "httpsWebURL" : "%https.ip%", @@ -15,7 +13,7 @@ "iOSConfigRoot" : "%https.ip%/ios-enrollment/", "iOSAPIRoot" : "%https.ip%/ios/", "adminService": "%https.ip%", - "apimgt-gateway": false, + "gatewayEnabled": false, "oauthProvider": { "appRegistration": { "appType": "webapp", @@ -32,19 +30,8 @@ "adminUser":"admin@carbon.super", "adminUserTenantId":"-1234", "adminRole":"admin", - "usernameLength":30, - "pageSize":10, - "ssoConfiguration" : { - "enabled" : false, - "issuer" : "devicemgt", - "appName" : "devicemgt", - "identityProviderURL" : "%https.ip%/sso/samlsso.jag", - "responseSigningEnabled" : "true", - "keyStorePassword" : "wso2carbon", - "identityAlias" : "wso2carbon", - "keyStoreName" : "/repository/resources/security/wso2carbon.jks" - }, "userValidationConfig" : { + "usernameLength":30, "usernameJSRegEx" : "^[\\S]{3,30}$", "usernameRegExViolationErrorMsg" : "Provided username is invalid.", "usernameHelpMsg" : "Should be in minimum 3 characters long and do not include any whitespaces.", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js index 9c969f4ab1..d9d51101c1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js @@ -138,7 +138,7 @@ var handlers = function () { "client credentials to session context. No username of logged in user is found as " + "input - setUpEncodedTenantBasedClientAppCredentials(x)"); } else { - if (devicemgtProps["apimgt-gateway"]) { + if (devicemgtProps["gatewayEnabled"]) { var tenantBasedClientAppCredentials = tokenUtil.getTenantBasedClientAppCredentials(username); if (!tenantBasedClientAppCredentials) { throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up encoded tenant " + @@ -176,7 +176,7 @@ var handlers = function () { "client credentials to session context. No username of logged in user is found as " + "input - setUpEncodedTenantBasedWebSocketClientAppCredentials(x)"); } else { - if (devicemgtProps["apimgt-gateway"]) { + if (devicemgtProps["gatewayEnabled"]) { var tenantBasedWebSocketClientAppCredentials = tokenUtil.getTenantBasedWebSocketClientAppCredentials(username); if (!tenantBasedWebSocketClientAppCredentials) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js index 6099b8a845..32f427090a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js @@ -33,7 +33,7 @@ function onRequest(context) { viewModel["roles"] = response["content"]; } - viewModel["charLimit"] = mdmProps["usernameLength"]; + viewModel["charLimit"] = mdmProps["userValidationConfig"]["usernameLength"]; viewModel["usernameJSRegEx"] = mdmProps["userValidationConfig"]["usernameJSRegEx"]; viewModel["usernameHelpText"] = mdmProps["userValidationConfig"]["usernameHelpMsg"]; viewModel["usernameRegExViolationErrorMsg"] = mdmProps["userValidationConfig"]["usernameRegExViolationErrorMsg"]; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.js index e1c4b583bd..a05bcc6e7f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.js @@ -40,7 +40,7 @@ function onRequest() { } var userStores = userModule.getSecondaryUserStores(); page["userStores"] = userStores; - page["charLimit"] = devicemgtProps["usernameLength"]; + page["charLimit"] = devicemgtProps["userValidationConfig"]["usernameLength"]; page["usernameJSRegEx"] = devicemgtProps["userValidationConfig"]["usernameJSRegEx"]; page["usernameHelpMsg"] = devicemgtProps["userValidationConfig"]["usernameHelpMsg"]; page["usernameRegExViolationErrorMsg"] = devicemgtProps["userValidationConfig"]["usernameRegExViolationErrorMsg"];