Merge branch 'release-3.0.x' of https://github.com/wso2/carbon-device-mgt-plugins into release-3.0.x

revert-dabc3590
ayyoob 8 years ago
commit 55d200514b

@ -689,28 +689,31 @@ function intializeWebsocketUrls() {
wso2.gadgets.state.getGlobalState(function (state) { wso2.gadgets.state.getGlobalState(function (state) {
deviceId = state.device.id; deviceId = state.device.id;
deviceType = state.device.type; deviceType = state.device.type;
var hostname = window.parent.location.hostname;
var port = window.parent.location.port;
if (deviceId && deviceType) { if (deviceId && deviceType) {
//TODO need to get the token
wso2.gadgets.identity.getUsername(function (username) { wso2.gadgets.identity.getUsername(function (username) {
wso2.gadgets.identity.getAccessToken(function (accessToken) {
$.getJSON("/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/get_server_info.jag?username=" + username, function (data) { $.getJSON("/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/get_server_info.jag?username=" + username, function (data) {
webSocketURL = 'wss://' + data.ip + ':' + data.httpsPort + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance webSocketURL = 'wss://' + hostname + ':' + port + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions .CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions
.constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain + .constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain +
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION .CEP_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION
+ "?deviceId=" + deviceId + "&deviceType=" + deviceType; + "?deviceId=" + deviceId + "&deviceType=" + deviceType;
alertWebSocketURL = 'wss://' + data.ip + ':' + data.httpsPort + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance alertWebSocketURL = 'wss://' + hostname + ':' + port + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
.CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions .CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions
.constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain + .constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain +
ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance
.CEP_ON_ALERT_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION .CEP_ON_ALERT_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION
+ "?deviceId=" + deviceId + "&deviceType=" + deviceType; + "?deviceId=" + deviceId + "&deviceType=" + deviceType;
document.cookie = "websocket-token=619e6170-10e8-31f0-904b-b7770d53e545; path=/"; document.cookie = "websocket-token=" + accessToken + "; path=/";
$("#proximity_alert").hide(); $("#proximity_alert").hide();
initializeWebSocket(); initializeWebSocket();
initializeOnAlertWebSocket(); initializeOnAlertWebSocket();
}); });
}); });
});
} else { } else {
$.UIkit.notify({ $.UIkit.notify({
message: 'Invalid Access! No device information provided to track!', message: 'Invalid Access! No device information provided to track!',

@ -116,7 +116,7 @@ public class SenseClientAsyncExecutor extends AsyncTask<String, Void, Map<String
TokenIssuerService tokenIssuerService = Feign.builder().client(disableHostnameVerification).requestInterceptor( TokenIssuerService tokenIssuerService = Feign.builder().client(disableHostnameVerification).requestInterceptor(
new BasicAuthRequestInterceptor(apiApplicationKey.getConsumerKey(), apiApplicationKey.getConsumerSecret())) new BasicAuthRequestInterceptor(apiApplicationKey.getConsumerKey(), apiApplicationKey.getConsumerSecret()))
.contract(new JAXRSContract()).encoder(new JacksonEncoder()).decoder(new JacksonDecoder()) .contract(new JAXRSContract()).encoder(new JacksonEncoder()).decoder(new JacksonDecoder())
.target(TokenIssuerService.class, endpoint + SenseConstants.TOKEN_ISSUER_CONTEXT); .target(TokenIssuerService.class, endpoint);
accessTokenInfo = tokenIssuerService.getToken(PASSWORD_GRANT_TYPE, username, password, "device_" + deviceId); accessTokenInfo = tokenIssuerService.getToken(PASSWORD_GRANT_TYPE, username, password, "device_" + deviceId);
//DeviceRegister //DeviceRegister

@ -39,7 +39,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:hint="@string/hostname" android:layout_height="wrap_content" android:hint="@string/hostname"
android:id="@+id/hostname" android:id="@+id/hostname"
android:text="https://localhost:9443" android:text="https://localhost:8243"
android:inputType="text" android:inputType="text"
android:maxLines="1" android:singleLine="true"/> android:maxLines="1" android:singleLine="true"/>

@ -1,7 +1,7 @@
<resources> <resources>
<string name="app_name">WSO2-SenseAgent</string> <string name="app_name">WSO2-SenseAgent</string>
<string name="title_activity_sense_settings">Sense Settings</string> <string name="title_activity_sense_settings">Sense Settings</string>
<string name="hostname">Server URL https://host:9443</string> <string name="hostname">Server URL https://host:8243</string>
<string name="speakup">Speakup to capture the words</string> <string name="speakup">Speakup to capture the words</string>
<string name="action_settings">DeEnroll</string> <string name="action_settings">DeEnroll</string>
<string name="title_activity_activity_select_sensor">ActivitySelectSensor</string> <string name="title_activity_activity_select_sensor">ActivitySelectSensor</string>

@ -121,9 +121,9 @@ if (uriMatcher.match("/{context}/api/user/authenticate")) {
} else { } else {
userRoles = String(addUserFormData.userRoles).split(","); userRoles = String(addUserFormData.userRoles).split(",");
} }
if (username.length < devicemgtProps.usernameLength) { if (username.length < devicemgtProps.userValidationConfig.usernameLength) {
log.error("Username Must be between 1 and " + devicemgtProps.usernameLength + " characters long"); log.error("Username Must be between 1 and " + devicemgtProps.userValidationConfig.usernameLength + " characters long");
result = "Username Must be between 1 and " + devicemgtProps.usernameLength + " characters long"; result = "Username Must be between 1 and " + devicemgtProps.userValidationConfig.usernameLength + " characters long";
} else { } else {
try { try {
result = userModule.addUser(username, firstname, lastname, emailAddress, userRoles); result = userModule.addUser(username, firstname, lastname, emailAddress, userRoles);

@ -1,6 +1,5 @@
{ {
"appContext" : "/android-web-agent/", "appContext" : "/android-web-agent/",
"apiContext" : "api",
"httpsURL" : "%https.ip%", "httpsURL" : "%https.ip%",
"httpURL" : "%http.ip%", "httpURL" : "%http.ip%",
"enrollmentDir": "/android-web-agent/enrollment", "enrollmentDir": "/android-web-agent/enrollment",
@ -24,7 +23,9 @@
"tokenServiceURL": "%https.ip%/oauth2/token" "tokenServiceURL": "%https.ip%/oauth2/token"
}, },
"adminUser":"admin", "adminUser":"admin",
"usernameLength":30, "userValidationConfig" : {
"usernameLength":30
},
"device" : { "device" : {
"ios" : { "ios" : {
"location" : "%http.ip%/android-web-agent/public/mdm.page.enrollments.ios.download-agent/asset/ios-agent.ipa", "location" : "%http.ip%/android-web-agent/public/mdm.page.enrollments.ios.download-agent/asset/ios-agent.ipa",
@ -35,16 +36,6 @@
}, },
"androidAgentApp" : "android-agent.apk", "androidAgentApp" : "android-agent.apk",
"windowsConfigRoot" : "%http.ip%/api/device-mgt/windows/v1.0/services/federated/bst/authentication", "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" : { "generalConfig" : {
"host" : "%http.ip%", "host" : "%http.ip%",
"companyName" : "WSO2 Enterprise Mobility Manager", "companyName" : "WSO2 Enterprise Mobility Manager",

@ -121,9 +121,9 @@ if (uriMatcher.match("/{context}/api/user/authenticate")) {
} else { } else {
userRoles = String(addUserFormData.userRoles).split(","); userRoles = String(addUserFormData.userRoles).split(",");
} }
if (username.length < devicemgtProps.usernameLength) { if (username.length < devicemgtProps.userValidationConfig.usernameLength) {
log.error("Username Must be between 1 and " + devicemgtProps.usernameLength + " characters long"); log.error("Username Must be between 1 and " + devicemgtProps.userValidationConfig.usernameLength + " characters long");
result = "Username Must be between 1 and " + devicemgtProps.usernameLength + " characters long"; result = "Username Must be between 1 and " + devicemgtProps.userValidationConfig.usernameLength + " characters long";
} else { } else {
try { try {
result = userModule.addUser(username, firstname, lastname, emailAddress, userRoles); result = userModule.addUser(username, firstname, lastname, emailAddress, userRoles);

@ -1,6 +1,5 @@
{ {
"appContext" : "/windows-web-agent/", "appContext" : "/windows-web-agent/",
"apiContext" : "api",
"httpsURL" : "%https.ip%", "httpsURL" : "%https.ip%",
"httpURL" : "%http.ip%", "httpURL" : "%http.ip%",
"enrollmentDir": "/windows-web-agent/enrollment", "enrollmentDir": "/windows-web-agent/enrollment",
@ -24,7 +23,9 @@
"tokenServiceURL": "%https.ip%/oauth2/token" "tokenServiceURL": "%https.ip%/oauth2/token"
}, },
"adminUser":"admin", "adminUser":"admin",
"usernameLength":30, "userValidationConfig": {
"usernameLength":30
},
"device" : { "device" : {
"ios" : { "ios" : {
"location" : "%http.ip%/windows-web-agent/public/mdm.page.enrollments.ios.download-agent/asset/ios-agent.ipa", "location" : "%http.ip%/windows-web-agent/public/mdm.page.enrollments.ios.download-agent/asset/ios-agent.ipa",
@ -35,16 +36,6 @@
}, },
"androidAgentApp" : "android-agent.apk", "androidAgentApp" : "android-agent.apk",
"windowsConfigRoot" : "%http.ip%/api/device-mgt/windows/v1.0/federated/bst/authentication", "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" : { "generalConfig" : {
"host" : "%http.ip%", "host" : "%http.ip%",
"companyName" : "WSO2 Enterprise Mobility Manager", "companyName" : "WSO2 Enterprise Mobility Manager",

@ -142,7 +142,7 @@ var handlers = function () {
"client credentials to session context as the server is unable to obtain " + "client credentials to session context as the server is unable to obtain " +
"dynamic client credentials - setUpEncodedTenantBasedClientAppCredentials(x)"); "dynamic client credentials - setUpEncodedTenantBasedClientAppCredentials(x)");
} else { } else {
if (devicemgtProps["apimgt-gateway"]) { if (devicemgtProps["gatewayEnabled"]) {
var jwtToken = tokenUtil.getAccessTokenByJWTGrantType(dynamicClientAppCredentials); var jwtToken = tokenUtil.getAccessTokenByJWTGrantType(dynamicClientAppCredentials);
if (!jwtToken) { if (!jwtToken) {
throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up encoded tenant based " + throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up encoded tenant based " +

@ -32,7 +32,7 @@ under the License. --}}
{{ {{
unit "mdm.unit.wizard-stepper" unit "mdm.unit.wizard-stepper"
steps = "Start Workplace, steps = "Start Workplace,
Login to Enterprise Mobility Manager, Login to WSO2 IoT Server,
Accept End User License Agreement" Accept End User License Agreement"
currentStep = "Start Workplace" currentStep = "Start Workplace"
currentStepIndex = 0 currentStepIndex = 0
@ -40,7 +40,7 @@ under the License. --}}
Start the Workplace app to continue device enrollment. Start the Workplace app to continue device enrollment.
<br class="c-both" /> <br class="c-both" />
<br class="c-both" /> <br class="c-both" />
Setting up a Workplace account with WSO2 Enterprise Mobility Manager Setting up a Workplace account with WSO2 IoT Server
will offer you company policies, certificates and apps that help you connect will offer you company policies, certificates and apps that help you connect
to your business. to your business.
<br class="c-both" /> <br class="c-both" />

@ -32,7 +32,7 @@ under the License. --}}
{{ {{
unit "mdm.unit.wizard-stepper" unit "mdm.unit.wizard-stepper"
steps = "Start Workplace, steps = "Start Workplace,
Login to Enterprise Mobility Manager, Login to WSO2 IoT Server,
Accept End User License Agreement" Accept End User License Agreement"
currentStep = "Accept End User License Agreement" currentStep = "Accept End User License Agreement"
currentStepIndex = 2 currentStepIndex = 2

@ -25,7 +25,7 @@ under the License. --}}
}} }}
{{/zone}} {{/zone}}
{{!-- Inputting content into defined zones in enrollment layout --}} {{!-- Inputting content into defined zones in enrollment layout --}}
{{unit "mdm.unit.ui.title" pageTitle="Windows Phone Enrollment | Login to Enterprise Mobility Manager"}} {{unit "mdm.unit.ui.title" pageTitle="Windows Phone Enrollment | Login to WSO2 IoT Server"}}
{{#zone "headerTitle"}} {{#zone "headerTitle"}}
Windows Phone Enrollment Windows Phone Enrollment
{{/zone}} {{/zone}}
@ -33,9 +33,9 @@ under the License. --}}
{{ {{
unit "mdm.unit.wizard-stepper" unit "mdm.unit.wizard-stepper"
steps = "Start Workplace, steps = "Start Workplace,
Login to Enterprise Mobility Manager, Login to WSO2 IoT Server,
Accept End User License Agreement" Accept End User License Agreement"
currentStep = "Login to Enterprise Mobility Manager" currentStep = "Login to WSO2 IoT Server"
currentStepIndex = 1 currentStepIndex = 1
}} }}
{{ {{

Loading…
Cancel
Save