diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
index 25dd56e5ee..8174536bd2 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml
@@ -22,13 +22,13 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.annotations
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - API Management Annotations
WSO2 Carbon - API Management Custom Annotation Module
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
index be9f3e24ff..4894c6a3ba 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml
@@ -21,12 +21,12 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
org.wso2.carbon.apimgt.application.extension.api
war
WSO2 Carbon - API Application Management API
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
index 9d7464de56..3f240c3340 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml
@@ -22,12 +22,12 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
org.wso2.carbon.apimgt.application.extension
bundle
WSO2 Carbon - API Application Management
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java
index 07f8a2a8a7..af471ebd6e 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java
@@ -93,7 +93,7 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
APIList apiList = storeClient.getApis().apisGet(MAX_API_PER_TAG, 0, tenantDomain, "tag:" + tag
, CONTENT_TYPE, null);
- if (apiList.getList() != null && apiList.getList().size() == 0) {
+ if (apiList.getList() == null || apiList.getList().size() == 0) {
apiList = storeClient.getApis().apisGet(MAX_API_PER_TAG, 0
, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, "tag:" + tag, CONTENT_TYPE, null);
}
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml
index 96e1570cdb..272d0c5e34 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml
@@ -21,13 +21,13 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.handlers
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - API Security Handler Component
WSO2 Carbon - API Management Security Handler Module
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml
index 0bac2f2121..5a9ada7d42 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml
@@ -14,13 +14,13 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 2.0.12-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.integration.client
- 2.0.12-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - API Management Integration Client
WSO2 Carbon - API Management Integration Client
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml
index 570776ab20..eb154f0102 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml
@@ -22,13 +22,13 @@
apimgt-extensions
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.webapp.publisher
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - API Management Webapp Publisher
WSO2 Carbon - API Management Webapp Publisher
diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/listener/APIPublisherLifecycleListener.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/listener/APIPublisherLifecycleListener.java
index 24c73c739d..3f0730b36a 100644
--- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/listener/APIPublisherLifecycleListener.java
+++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/listener/APIPublisherLifecycleListener.java
@@ -109,14 +109,11 @@ public class APIPublisherLifecycleListener implements LifecycleListener {
} catch (UserStoreException e) {
log.error("Error while retrieving tenant admin user for the tenant domain"
+ PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(), e);
+ } catch (Throwable e) {
+ // This is done to stop tomcat failure if a webapp failed to publish apis.
+ log.error("Failed to Publish api from " + servletContext.getContextPath(), e);
}
}
}
}
-
- //TODO : Need to implemented, to merge API Definitions in cases where implementation of an API Lies in two classes
- private List mergeAPIDefinitions(List inputList) {
- return null;
- }
-
}
diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml
index 467f14aae8..b7ba0a2747 100644
--- a/components/apimgt-extensions/pom.xml
+++ b/components/apimgt-extensions/pom.xml
@@ -22,13 +22,13 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
apimgt-extensions
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - API Management Extensions Component
http://wso2.org
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
index c91b714430..948ba6691b 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml
@@ -22,7 +22,7 @@
certificate-mgt
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
index aed7787a27..955bb55fa2 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml
@@ -22,7 +22,7 @@
certificate-mgt
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
index e9ecadb44b..764f381934 100644
--- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
+++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml
@@ -21,13 +21,13 @@
org.wso2.carbon.devicemgt
certificate-mgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.certificate.mgt.core
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - Certificate Management Core
WSO2 Carbon - Certificate Management Core
diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml
index 6a5e3a4d1d..44988a66b4 100644
--- a/components/certificate-mgt/pom.xml
+++ b/components/certificate-mgt/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
org.wso2.carbon.devicemgt
certificate-mgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Certificate Management Component
http://wso2.org
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
index b9bebfed03..435730554e 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/test/resources/sample.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/test/resources/sample.xml
index aa18e5d03b..6542d9629b 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/test/resources/sample.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/test/resources/sample.xml
@@ -36,10 +36,10 @@
-
+
false
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml
index d7ee06a319..e4af0cccb0 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
index 4090ceb837..01626d2475 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
index 9cc250c652..47cd64f41e 100644
--- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
+++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml
index 871f5a3935..f1a3bc5edd 100644
--- a/components/device-mgt-extensions/pom.xml
+++ b/components/device-mgt-extensions/pom.xml
@@ -22,7 +22,7 @@
carbon-devicemgt
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml
index 358e1f0ebe..8bd503dc20 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml
@@ -3,7 +3,7 @@
org.wso2.carbon.devicemgt
device-mgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml
index 00bbf73e04..7a35748c11 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
index 7dee3b0012..11b998998d 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml
@@ -22,7 +22,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
@@ -281,6 +281,11 @@
javax.ws.rs
javax.ws.rs-api
+
+ org.wso2.carbon.commons
+ org.wso2.carbon.application.mgt.stub
+ provided
+
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypePublisherAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypePublisherAdminService.java
new file mode 100644
index 0000000000..7914f9d071
--- /dev/null
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypePublisherAdminService.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.wso2.carbon.device.mgt.jaxrs.service.api.admin;
+
+
+import io.swagger.annotations.*;
+import org.wso2.carbon.apimgt.annotations.api.Scope;
+import org.wso2.carbon.apimgt.annotations.api.Scopes;
+import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
+import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+
+@SwaggerDefinition(
+ info = @Info(
+ version = "1.0.0",
+ title = "",
+ extensions = {
+ @Extension(properties = {
+ @ExtensionProperty(name = "name", value = "DeviceTypePublisherAdminService"),
+ @ExtensionProperty(name = "context", value = "/api/device-mgt/v1.0/admin/devicetype"),
+ })
+ }
+ ),
+ tags = {
+ @Tag(name = "device_management", description = "")
+ }
+)
+@Path("/admin/devicetype")
+@Api(value = "Devicetype deployment Administrative Service", description = "This an API intended to be used to " +
+ "deploy device type components" +
+ "Further, this is strictly restricted to admin users only ")
+@Scopes(
+ scopes = {
+ @Scope(
+ name = "Devicetype deployment",
+ description = "Deploy devicetype",
+ key = "perm:devicetype:deployment",
+ permissions = {"/device-mgt/devicetype/deploy"}
+ )
+ }
+)
+
+public interface DeviceTypePublisherAdminService {
+
+ @POST
+ @Path("/deploy/{type}")
+ @ApiOperation(
+ httpMethod = "POST",
+ value = "Deploy device type\n",
+ notes = "This is an API that can be used to deploy existing device type artifact for tenant",
+ response = Response.class,
+ tags = "Devicetype Deployment Service",
+ extensions = {
+ @Extension(properties = {
+ @ExtensionProperty(name = Constants.SCOPE, value = "perm:devicetype:deployment")
+ })
+ })
+
+ @ApiResponses(value = {
+ @ApiResponse(
+ code = 201,
+ message = "OK. \n Successfully deployed the artifacts.",
+ response = Response.class),
+ @ApiResponse(
+ code = 400,
+ message = "Bad Request. \n Invalid request or validation error.",
+ response = ErrorResponse.class),
+ @ApiResponse(
+ code = 404,
+ message = "Not Found. \n The specified resource does not exist."),
+ @ApiResponse(
+ code = 415,
+ message = "Unsupported media type. \n The entity of the request was in a not supported format."),
+ @ApiResponse(
+ code = 500,
+ message = "Internal Server Error. \n Server error occurred while checking the authorization" +
+ " for a specified set of devices.",
+ response = ErrorResponse.class)
+ })
+
+ Response doPublish(
+ @ApiParam(name = "type",
+ value = "The type of deployment." +
+ "INFO: Deploy artifact with given type.",
+ required = true)
+ @PathParam("type") String type);
+
+ @GET
+ @Path("/deploy/{type}/status")
+ @ApiOperation(
+ httpMethod = "GET",
+ value = "Check the status of device type artifact\n",
+ notes = "This is an API that can be used to check the status of the artifact",
+ response = Response.class,
+ tags = "Devicetype Status Service",
+ extensions = {
+ @Extension(properties = {
+ @ExtensionProperty(name = Constants.SCOPE, value = "perm:devicetype:deployment")
+ })
+ })
+
+ @ApiResponses(value = {
+ @ApiResponse(
+ code = 201,
+ message = "OK. \n Successfully deployed the artifacts.",
+ response = Response.class),
+ @ApiResponse(
+ code = 400,
+ message = "Bad Request. \n Invalid request or validation error.",
+ response = ErrorResponse.class),
+ @ApiResponse(
+ code = 404,
+ message = "Not Found. \n The specified resource does not exist."),
+ @ApiResponse(
+ code = 415,
+ message = "Unsupported media type. \n The entity of the request was in a not supported format."),
+ @ApiResponse(
+ code = 500,
+ message = "Internal Server Error. \n Server error occurred while checking the authorization" +
+ " for a specified set of devices.",
+ response = ErrorResponse.class)
+ })
+
+ Response getStatus(@PathParam("type") String deviceType);
+
+}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypePublisherAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypePublisherAdminServiceImpl.java
new file mode 100644
index 0000000000..66548fee52
--- /dev/null
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypePublisherAdminServiceImpl.java
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.wso2.carbon.device.mgt.jaxrs.service.impl.admin;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.java.security.SSLProtocolSocketFactory;
+import org.apache.axis2.transport.http.HTTPConstants;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.protocol.Protocol;
+import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.application.mgt.stub.upload.CarbonAppUploaderStub;
+import org.wso2.carbon.application.mgt.stub.upload.types.carbon.UploadedFileItem;
+import org.wso2.carbon.base.ServerConfiguration;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
+import org.wso2.carbon.core.util.Utils;
+import org.wso2.carbon.device.mgt.jaxrs.service.api.admin.DeviceTypePublisherAdminService;
+import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils;
+import org.wso2.carbon.registry.core.Registry;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.ResourceImpl;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.utils.CarbonUtils;
+
+import javax.activation.DataHandler;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManagerFactory;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.Response;
+import java.io.*;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+import java.util.ArrayList;
+import java.util.List;
+
+@Path("/admin/devicetype")
+public class DeviceTypePublisherAdminServiceImpl implements DeviceTypePublisherAdminService {
+
+ /**
+ * required soap header for mutualSSL
+ */
+ private static final String USER_NAME_HEADER = "UserName";
+
+ private static final String KEY_STORE_TYPE = "JKS";
+ /**
+ * Default truststore type of the client
+ */
+ private static final String TRUST_STORE_TYPE = "JKS";
+ /**
+ * Default keymanager type of the client
+ */
+ private static final String KEY_MANAGER_TYPE = "SunX509"; //Default Key Manager Type
+ /**
+ * Default trustmanager type of the client
+ */
+ private static final String TRUST_MANAGER_TYPE = "SunX509"; //Default Trust Manager Type
+
+ private static final String SSLV3 = "SSLv3";
+
+ private KeyStore keyStore;
+ private KeyStore trustStore;
+ private char[] keyStorePassword;
+ private SSLContext sslContext;
+
+ private static final Log log = LogFactory.getLog(DeviceTypePublisherAdminServiceImpl.class);
+ private static final String DEFAULT_RESOURCE_LOCATION = "/resources/devicetypes";
+ private static final String CAR_FILE_LOCATION = CarbonUtils.getCarbonHome() + File.separator + "repository" +
+ File.separator + "resources" + File.separator + "devicetypes";
+ private static final String DAS_PORT = "${iot.analytics.https.port}";
+ private static final String DAS_HOST_NAME = "${iot.analytics.host}";
+ private static final String DEFAULT_HTTP_PROTOCOL = "https";
+ private static final String IOT_MGT_PORT = "${iot.manager.https.port}";
+ private static final String IOT_MGT_HOST_NAME = "${iot.manager.host}";
+ private static final String DAS_URL = DEFAULT_HTTP_PROTOCOL + "://" + DAS_HOST_NAME
+ + ":" + DAS_PORT + "/services/CarbonAppUploader" + "/";
+ private static final String IOT_MGT_URL = DEFAULT_HTTP_PROTOCOL + "://" + IOT_MGT_HOST_NAME
+ + ":" + IOT_MGT_PORT + "/services/CarbonAppUploader" + "/";
+ private static final String MEDIA_TYPE_XML = "application/xml";
+ private static final String DEVICE_MANAGEMENT_TYPE = "device_management";
+
+ @Override
+ @POST
+ @Path("/deploy/{type}")
+ public Response doPublish(@PathParam("type") String type) {
+
+ try {
+ //Getting the tenant Domain
+ String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+ String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
+ String tenantAdminUser = username + "@" + tenantDomain;
+
+ String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
+ String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
+ "Security.TrustStore.Password");
+ String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location");
+ String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty(
+ "Security.TrustStore.Location");
+
+ //Call to load the keystore.
+ loadKeyStore(keyStoreLocation, keyStorePassword);
+ //Call to load the TrustStore.
+ loadTrustStore(trustStoreLocation, trustStorePassword);
+ //Create the SSL context with the loaded TrustStore/keystore.
+ initMutualSSLConnection();
+
+ //Constructing the soap header that required for mutual SSL
+ String strHeader =
+ "'" + tenantAdminUser +
+ "'";
+
+ InputStream is = new ByteArrayInputStream(strHeader.getBytes());
+ OMElement header = OMXMLBuilderFactory.createOMBuilder(is).getDocumentElement();
+
+ List list = new ArrayList();
+ Header httpHeader = new Header();
+ httpHeader.setName(USER_NAME_HEADER);
+ byte[] encodedBytes = Base64.encodeBase64(tenantAdminUser.getBytes());
+ httpHeader.setValue(new String(encodedBytes));
+ list.add(httpHeader);//"https"
+
+ File directory = new File(CAR_FILE_LOCATION + File.separator + type);
+ if (directory.isDirectory() && directory.exists()) {
+ UploadedFileItem[] uploadedFileItems = loadCappFromFileSystem(type);
+ if (uploadedFileItems.length > 0) {
+ CarbonAppUploaderStub carbonAppUploaderStub = new CarbonAppUploaderStub(Utils.replaceSystemProperty(
+ IOT_MGT_URL));
+ carbonAppUploaderStub._getServiceClient().addHeader(header);
+ Options appUploaderOptions = carbonAppUploaderStub._getServiceClient().getOptions();
+ if (appUploaderOptions == null) {
+ appUploaderOptions = new Options();
+ }
+ appUploaderOptions.setProperty(HTTPConstants.HTTP_HEADERS, list);
+ appUploaderOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER
+ , new Protocol(DEFAULT_HTTP_PROTOCOL, (ProtocolSocketFactory) new SSLProtocolSocketFactory
+ (sslContext), Integer.parseInt(Utils.replaceSystemProperty(IOT_MGT_PORT))));
+
+ carbonAppUploaderStub._getServiceClient().setOptions(appUploaderOptions);
+ carbonAppUploaderStub.uploadApp(uploadedFileItems);
+
+ if (!DEVICE_MANAGEMENT_TYPE.equals(type.toLowerCase())) {
+ carbonAppUploaderStub = new CarbonAppUploaderStub(Utils.replaceSystemProperty(DAS_URL));
+ carbonAppUploaderStub._getServiceClient().addHeader(header);
+ appUploaderOptions = carbonAppUploaderStub._getServiceClient().getOptions();
+ if (appUploaderOptions == null) {
+ appUploaderOptions = new Options();
+ }
+ appUploaderOptions.setProperty(HTTPConstants.HTTP_HEADERS, list);
+ appUploaderOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER
+ , new Protocol(DEFAULT_HTTP_PROTOCOL
+ , (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslContext)
+ , Integer.parseInt(Utils.replaceSystemProperty(DAS_PORT))));
+
+ carbonAppUploaderStub._getServiceClient().setOptions(appUploaderOptions);
+ carbonAppUploaderStub.uploadApp(uploadedFileItems);
+ }
+ int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
+ Registry registry = DeviceMgtAPIUtils.getRegistryService().getConfigSystemRegistry(tenantId);
+ if (!registry.resourceExists(DEFAULT_RESOURCE_LOCATION + type + ".exist")) {
+ Resource resource = new ResourceImpl();
+ resource.setContent("");
+ resource.setMediaType(MEDIA_TYPE_XML);
+ registry.put(DEFAULT_RESOURCE_LOCATION + type + ".exist", resource);
+ }
+ }
+ } else {
+ return Response.status(Response.Status.BAD_REQUEST)
+ .entity("\"Error, Artifact does not exist.\"").build();
+ }
+
+ } catch (Exception e) {
+ log.error("Capp deployment failed due to " + e.getMessage(), e);
+ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(
+ "\"Error, Artifact deployment has failed\"").build();
+ }
+
+ return Response.status(Response.Status.CREATED).entity("\"OK. \\n Successfully uploaded the artifacts.\"")
+ .build();
+ }
+
+ @GET
+ @Path("/deploy/{type}/status")
+ @Override
+ public Response getStatus(@PathParam("type") String deviceType) {
+ int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
+ Registry registry = null;
+ try {
+ registry = DeviceMgtAPIUtils.getRegistryService().getConfigSystemRegistry(tenantId);
+ if (registry.resourceExists(DEFAULT_RESOURCE_LOCATION + deviceType + ".exist")) {
+ return Response.status(Response.Status.OK).entity("Exist").build();
+ } else {
+ return Response.status(Response.Status.NO_CONTENT).entity("Does not Exist").build();
+ }
+ } catch (RegistryException e) {
+ log.error("Registry failed to load." + e.getMessage(), e);
+ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(
+ "\"Error, Artifact status check has failed\"").build();
+ }
+ }
+
+ private UploadedFileItem[] loadCappFromFileSystem(String deviceType) throws IOException {
+
+ File directory = new File(CAR_FILE_LOCATION + File.separator + deviceType);
+ File[] carFiles = directory.listFiles(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return name.toLowerCase().endsWith(".car");
+ }
+ });
+ List uploadedFileItemLis = new ArrayList<>();
+ if (carFiles != null) {
+
+ for (File carFile : carFiles) {
+ UploadedFileItem uploadedFileItem = new UploadedFileItem();
+ DataHandler param = new DataHandler(carFile.toURI().toURL());
+ uploadedFileItem.setDataHandler(param);
+ uploadedFileItem.setFileName(carFile.getName());
+ uploadedFileItem.setFileType("jar");
+ uploadedFileItemLis.add(uploadedFileItem);
+ }
+ }
+ UploadedFileItem[] fileItems = new UploadedFileItem[uploadedFileItemLis.size()];
+ fileItems = uploadedFileItemLis.toArray(fileItems);
+ return fileItems;
+ }
+
+ /**
+ * Loads the keystore.
+ *
+ * @param keyStorePath - the path of the keystore
+ * @param ksPassword - the keystore password
+ */
+ private void loadKeyStore(String keyStorePath, String ksPassword)
+ throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
+ InputStream fis = null;
+ try {
+ keyStorePassword = ksPassword.toCharArray();
+ keyStore = KeyStore.getInstance(KEY_STORE_TYPE);
+ fis = new FileInputStream(keyStorePath);
+ keyStore.load(fis, keyStorePassword);
+ } finally {
+ if (fis != null) {
+ fis.close();
+ }
+ }
+ }
+
+ /**
+ * Loads the trustore
+ *
+ * @param trustStorePath - the trustore path in the filesystem.
+ * @param tsPassword - the truststore password
+ */
+ private void loadTrustStore(String trustStorePath, String tsPassword)
+ throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException {
+
+ InputStream fis = null;
+ try {
+ trustStore = KeyStore.getInstance(TRUST_STORE_TYPE);
+ fis = new FileInputStream(trustStorePath);
+ trustStore.load(fis, tsPassword.toCharArray());
+ } finally {
+ if (fis != null) {
+ fis.close();
+ }
+ }
+ }
+
+ /**
+ * Initializes the SSL Context
+ */
+ private void initMutualSSLConnection() throws NoSuchAlgorithmException, UnrecoverableKeyException,
+ KeyStoreException, KeyManagementException {
+ KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KEY_MANAGER_TYPE);
+ keyManagerFactory.init(keyStore, keyStorePassword);
+ TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TRUST_MANAGER_TYPE);
+ trustManagerFactory.init(trustStore);
+
+ // Create and initialize SSLContext for HTTPS communication
+ sslContext = SSLContext.getInstance(SSLV3);
+ sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
+ SSLContext.setDefault(sslContext);
+ }
+
+
+}
+
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
index ad32fc3b98..2e562b03b3 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java
@@ -39,6 +39,7 @@ import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.InputValidationExcepti
import org.wso2.carbon.policy.mgt.common.PolicyMonitoringTaskException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
import org.wso2.carbon.policy.mgt.core.task.TaskScheduleService;
+import org.wso2.carbon.registry.core.service.RegistryService;
import org.wso2.carbon.user.api.AuthorizationManager;
import org.wso2.carbon.user.api.UserRealm;
import org.wso2.carbon.user.api.UserStoreException;
@@ -155,6 +156,18 @@ public class DeviceMgtAPIUtils {
return realmService;
}
+ public static RegistryService getRegistryService() {
+ RegistryService registryService;
+ PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ registryService = (RegistryService) ctx.getOSGiService(RegistryService.class, null);
+ if (registryService == null) {
+ String msg = "registry service has not initialized.";
+ log.error(msg);
+ throw new IllegalStateException(msg);
+ }
+ return registryService;
+ }
+
/**
* Getting the current tenant's user realm
*/
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml
index 7948186893..fd6c5e0309 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml
@@ -39,6 +39,8 @@
+
+
@@ -80,7 +82,9 @@
-
+
+
+
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
index b0cb8b4032..0067817575 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
@@ -21,7 +21,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
index e9728972d8..f2b7a661a4 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
index acca02f593..6b799048d0 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
@@ -22,7 +22,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml
index 65578b4e00..8476e6b962 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml
@@ -22,7 +22,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json
index 7087cdb976..bfe2bd2a0f 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json
@@ -31,7 +31,7 @@
"issuer" : "devicemgt",
"appName" : "devicemgt",
"identityProviderUrl" : "https://%iot.keymanager.host%:%iot.keymanager.https.port%/samlsso",
- "acs": "https://%iot.keymanager.host%:%iot.keymanager.https.port%/devicemgt/uuf/sso/acs",
+ "acs": "https://%iot.manager.host%:%iot.manager.https.port%/devicemgt/uuf/sso/acs",
"identityAlias": "wso2carbon",
"responseSigningEnabled" : true,
"validateAssertionValidityPeriod": true,
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 340aac83e8..fdd9550439 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
@@ -175,7 +175,8 @@
"perm:ios:remove-profile",
"perm:ios:get-restrictions",
"perm:ios:wipe-data",
- "perm:admin"
+ "perm:admin",
+ "perm:devicetype:deployment"
],
"isOAuthEnabled" : true,
"backendRestEndpoints" : {
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js
index d36e7af0ab..166859f89b 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js
@@ -26,7 +26,11 @@ var onFail;
var utility = require("/app/modules/utility.js").utility;
var apiWrapperUtil = require("/app/modules/oauth/token-handlers.js")["handlers"];
if (context.input.samlToken) {
- apiWrapperUtil.setupTokenPairBySamlGrantType(context.user.username + '@' + context.user.domain, context.input.samlToken);
+ //apiWrapperUtil.setupTokenPairBySamlGrantType(context.user.username + '@' + context.user.domain, context.input.samlToken);
+ /**
+ * Since the user can be verified using the sso.client.js we can use JWT grant type to issue the token for the user.
+ */
+ apiWrapperUtil.setupTokenPairByJWTGrantType(context.user.username + '@' + context.user.domain, context.input.samlToken);
} else {
apiWrapperUtil.setupTokenPairByPasswordGrantType(context.input.username, context.input.password);
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handler-utils.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handler-utils.js
index b31febe79a..109e67f7ac 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handler-utils.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handler-utils.js
@@ -22,6 +22,7 @@ var utils = function () {
var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var constants = require("/app/modules/constants.js");
var carbon = require("carbon");
+ var authModule = require("/lib/modules/auth/auth.js").module;
//noinspection JSUnresolvedVariable
var Base64 = Packages.org.apache.commons.codec.binary.Base64;
@@ -275,59 +276,34 @@ var utils = function () {
}
};
- publicMethods["getTokenPairAndScopesBySAMLGrantType"] = function (assertion, encodedClientAppCredentials, scopes) {
- if (!assertion || !encodedClientAppCredentials || !scopes) {
- log.error("{/app/modules/oauth/token-handler-utils.js} Error in retrieving access token by saml " +
- "grant type. No assertion, encoded client app credentials or scopes are " +
- "found - getTokenPairAndScopesBySAMLGrantType(x, y, z)");
- return null;
- } else {
- var assertionXML = publicMethods.decode(assertion);
- /*
- TODO: make assertion extraction with proper parsing.
- Since Jaggery XML parser seem to add formatting which causes signature verification to fail.
- */
- var assertionStartMarker = "
- WSO2 Carbon Device Management Framework v2.0.6
- WSO2 CDMF v2.0.6 | © ,
+ WSO2 IoT Server 3.1.0
+ WSO2 IoT Server 3.1.0 | © ,
Inc. All Rights Reserved.
{{/zone}}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/user-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/user-menu.hbs
index 8bc7d0b35b..386f4b6b5e 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/user-menu.hbs
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/user-menu.hbs
@@ -21,7 +21,7 @@
{{#if isSuperTenant }}
- {{@user.username}} "SERVER"
+ {{@user.username}}
{{else}}
{{@user.username}}@{{@user.domain}}
{{/if}}
@@ -120,4 +120,4 @@
{{#zone "bottomJs"}}
{{js "/js/user-menu.js"}}
-{{/zone}}
\ No newline at end of file
+{{/zone}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs
index 61655a5f44..c3a76babc9 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs
@@ -32,9 +32,29 @@
{{/if}}
{{#if permissions.VIEW_DASHBOARD}}
-
+
Device Statistics
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{/if}}
{{#if permissions.LIST_GROUPS}}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/public/js/nav-menu.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/public/js/nav-menu.js
index 2b7d3cf2d4..07ddd59f2a 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/public/js/nav-menu.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/public/js/nav-menu.js
@@ -20,7 +20,7 @@ var modalPopup = ".modal";
var modalPopupContainer = modalPopup + " .modal-content";
var modalPopupContent = modalPopup + " .modal-content";
-var emmAdminBasePath = "/api/device-mgt/v1.0";
+var backendEndBasePath = "/api/device-mgt/v1.0";
/*
* set popup maximum height function.
@@ -66,7 +66,7 @@ var updateNotificationCount = function (data, textStatus, jqXHR) {
function loadNotificationsPanel() {
if ("true" == $("#right-sidebar").attr("is-authorized")) {
- var serviceURL = emmAdminBasePath + "/notifications?status=NEW";
+ var serviceURL = backendEndBasePath + "/notifications?status=NEW";
invokerUtil.get(serviceURL, updateNotificationCount, hideNotificationCount);
loadNewNotifications();
} else {
@@ -90,7 +90,7 @@ function loadNewNotifications() {
var currentUser = notifications.data("currentUser");
$.template("notification-listing", notifications.attr("src"), function (template) {
- var serviceURL = emmAdminBasePath + "/notifications?status=NEW";
+ var serviceURL = backendEndBasePath + "/notifications?status=NEW";
var successCallback = function (data, textStatus, jqXHR) {
if (jqXHR.status == 200 && data) {
@@ -453,3 +453,44 @@ $(document).ready(function () {
});
}
});
+
+function statisticLoad(redirectUrl) {
+ var contentType = "application/json";
+
+ var uri = backendEndBasePath + "/admin/devicetype/deploy/device_management/status";
+ var defaultStatusClasses = "fw fw-stack-1x";
+ var content = $("#statistic-response-template").find(".content");
+ var title = content.find("#title");
+ var statusIcon = content.find("#status-icon");
+
+ invokerUtil.get(uri, function (data, textStatus, jqXHR) {
+ if (jqXHR.status == 204) {
+ var urix = backendEndBasePath + "/admin/devicetype/deploy/device_management";
+ var device = {};
+ invokerUtil.post(urix, device, function (data) {
+ title.html("Deploying statistic artifacts. Please wait...");
+ statusIcon.attr("class", defaultStatusClasses + " fw-check");
+ $(modalPopupContent).html(content.html());
+ showPopup();
+ setTimeout(function () {
+ hidePopup();
+ // location.reload(true);
+ location.href = redirectUrl;
+ }, 20000);
+
+ }, function (jqXHR) {
+ title.html("Failed to deploy artifacts, Please contact administrator.");
+ statusIcon.attr("class", defaultStatusClasses + " fw-error");
+ $(modalPopupContent).html(content.html());
+ showPopup();
+ }, contentType);
+ } else {
+ location.href = redirectUrl;
+ }
+ }, function (jqXHR) {
+ title.html("Failed to connect with server, Please contact administrator.");
+ statusIcon.attr("class", defaultStatusClasses + " fw-error");
+ $(modalPopupContent).html(content.html());
+ showPopup();
+ }, contentType);
+}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/modules/auth/auth.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/modules/auth/auth.js
index 93cffdbf86..fad0b27b99 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/modules/auth/auth.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/modules/auth/auth.js
@@ -565,6 +565,76 @@ var module = {};
}
};
+
+ /**
+ * saml token validation Service.
+ * @param request {Object} HTTP request
+ * @param response {Object} HTTP response
+ */
+ module.ssoLogin = function (samlToken) {
+ var samlResponse = samlToken;
+ var ssoClient = require("sso").client;
+ var samlResponseObj;
+
+ if (samlResponse) {
+ try {
+ samlResponseObj = ssoClient.getSamlObject(samlResponse);
+ } catch (e) {
+ log.error(e.message, e);
+ return;
+ }
+
+ // This is a login response.
+ var ssoConfigs = getSsoConfigurations();
+ var CarbonUtils = Packages.org.wso2.carbon.utils.CarbonUtils;
+ var keyStorePassword = CarbonUtils.getServerConfiguration().getFirstProperty("Security.TrustStore.Password");
+ var keyStoreName = CarbonUtils.getServerConfiguration().getFirstProperty("Security.TrustStore.Location");
+ var identityAlias = ssoConfigs[constants.APP_CONF_AUTH_MODULE_SSO_IDENTITY_ALIAS];
+ var keyStoreParams = {
+ KEY_STORE_NAME: keyStoreName,
+ KEY_STORE_PASSWORD: keyStorePassword,
+ IDP_ALIAS: identityAlias
+ };
+ var rsEnabled = ssoConfigs[constants.APP_CONF_AUTH_MODULE_SSO_RESPONSE_SIGNING_ENABLED];
+ if (utils.parseBoolean(rsEnabled)) {
+ if (!ssoClient.validateSignature(samlResponseObj, keyStoreParams)) {
+ var msg = "Invalid signature found in the SAML response.";
+ log.error(msg);
+ return;
+ }
+ }
+
+ if (!ssoClient.validateSamlResponse(samlResponseObj, ssoConfigs, keyStoreParams)) {
+ var msg = "Invalid SAML response found.";
+ log.error(msg);
+ return;
+ }
+
+ /**
+ * @type {{sessionId: string, loggedInUser: string, sessionIndex: string, samlToken:
+ * string}}
+ */
+ var ssoSession = ssoClient.decodeSAMLLoginResponse(samlResponseObj, samlResponse,
+ session.getId());
+ if (ssoSession.sessionId) {
+ var ssoSessions = getSsoSessions();
+ ssoSessions[ssoSession.sessionId] = ssoSession;
+ if (ssoSession.sessionIndex) {
+ var carbonUser = (require("carbon")).server.tenantUser(ssoSession.loggedInUser);
+ utils.setCurrentUser(carbonUser.username, carbonUser.domain, carbonUser.tenantId);
+ module.loadTenant(ssoSession.loggedInUser);
+ var user = {user: module.getCurrentUser()};
+ return user;
+ }
+ } else {
+ var msg = "Cannot decode SAML login response.";
+ log.error(msg);
+ return;
+ }
+
+ }
+ };
+
/**
* Load current user tenant
* @param username logged user name
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml
index 6068e21032..48c3755ddb 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml
@@ -23,7 +23,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml
index 8b64683016..d079a852f4 100644
--- a/components/device-mgt/pom.xml
+++ b/components/device-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
diff --git a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml
index 4b3789930e..dd783d7bb3 100644
--- a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml
+++ b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
email-sender
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/email-sender/pom.xml b/components/email-sender/pom.xml
index b72645fc5f..245c1da23e 100644
--- a/components/email-sender/pom.xml
+++ b/components/email-sender/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml
index 53ae4d5bdb..c7cb351cfc 100644
--- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml
+++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml
@@ -21,7 +21,7 @@
dynamic-client-registration
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml
index 9c9c48aba2..d160b902b2 100644
--- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml
+++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml
@@ -21,7 +21,7 @@
dynamic-client-registration
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml
index 6a2af20689..1c2bd4c876 100644
--- a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml
+++ b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml
@@ -21,13 +21,13 @@
dynamic-client-registration
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.dynamic.client.registration
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - Dynamic client registration service
WSO2 Carbon - Dynamic Client Registration Service
diff --git a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml
index f2bc60114c..f4c093fba9 100644
--- a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml
+++ b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml
@@ -21,13 +21,13 @@
dynamic-client-registration
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.dynamic.client.web.app.registration
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - Dynamic client web app registration
WSO2 Carbon - Dynamic Client Web-app Registration Service
diff --git a/components/identity-extensions/dynamic-client-registration/pom.xml b/components/identity-extensions/dynamic-client-registration/pom.xml
index 79c63da111..08c77ec516 100644
--- a/components/identity-extensions/dynamic-client-registration/pom.xml
+++ b/components/identity-extensions/dynamic-client-registration/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
identity-extensions
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.devicemgt
dynamic-client-registration
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Dynamic client registration
http://wso2.org
diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml
index 794527132b..7406555132 100644
--- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml
+++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml
@@ -22,13 +22,13 @@
org.wso2.carbon.devicemgt
identity-extensions
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.oauth.extensions
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - OAuth Extensions
http://wso2.org
@@ -58,6 +58,10 @@
org.wso2.carbon.identity.framework
org.wso2.carbon.user.mgt
+
+ org.wso2.carbon.identity
+ org.wso2.carbon.identity.oauth2.grant.jwt
+
@@ -83,6 +87,7 @@
org.wso2.carbon.device.mgt.oauth.extensions.*
+ org.wso2.carbon.identity.oauth2.grant.jwt;version="${carbon.identity.jwt.grant.version.range}",
org.apache.commons.logging,
org.osgi.service.component,
org.wso2.carbon.identity.application.common.model;version="${carbon.identity.framework.version.range}",
diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java
new file mode 100644
index 0000000000..006317f179
--- /dev/null
+++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.apimgt.keymgt.ScopesIssuer;
+import org.wso2.carbon.base.MultitenantConstants;
+import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
+import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception;
+import org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler;
+import org.wso2.carbon.identity.oauth2.model.RequestParameter;
+import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext;
+import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
+
+/**
+ * This sets up user with tenant aware username.
+ */
+@SuppressWarnings("unused")
+public class ExtendedJWTGrantHandler extends JWTBearerGrantHandler {
+ private static Log log = LogFactory.getLog(ExtendedJWTGrantHandler.class);
+ private static final String TENANT_DOMAIN_KEY = "tenantDomain";
+
+ @Override
+ public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) {
+ return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx);
+ }
+
+ @Override
+ public boolean validateGrant(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception {
+
+ RequestParameter[] requestParameters = tokReqMsgCtx.getOauth2AccessTokenReqDTO().getRequestParameters();
+ for (RequestParameter requestParameter : requestParameters) {
+ if (TENANT_DOMAIN_KEY.equals(requestParameter.getKey())) {
+ String[] values = requestParameter.getValue();
+ if (values != null && values.length > 0) {
+ tokReqMsgCtx.getOauth2AccessTokenReqDTO()
+ .setTenantDomain(values[0]);
+ }
+ }
+ }
+
+ return super.validateGrant(tokReqMsgCtx);
+ }
+}
diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml
index 4b71180656..9a48123286 100644
--- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml
+++ b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml
@@ -21,7 +21,7 @@
identity-extensions
org.wso2.carbon.devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
4.0.0
diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml
index aee30bdda2..9426233579 100644
--- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml
+++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
identity-extensions
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/JWTClient.java b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/JWTClient.java
index ad7d547090..dc51a2c9df 100644
--- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/JWTClient.java
+++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/JWTClient.java
@@ -80,6 +80,25 @@ public class JWTClient {
return getTokenInfo(params, consumerKey, consumerSecret);
}
+ public AccessTokenInfo getAccessToken(String encodedAppcredential, String username, String scopes)
+ throws JWTClientException {
+ List params = new ArrayList<>();
+ params.add(new BasicNameValuePair(JWTConstants.GRANT_TYPE_PARAM_NAME, jwtConfig.getJwtGrantType()));
+ String assertion = JWTClientUtil.generateSignedJWTAssertion(username, jwtConfig, isDefaultJWTClient);
+ if (assertion == null) {
+ throw new JWTClientException("JWT is not configured properly for user : " + username);
+ }
+ params.add(new BasicNameValuePair(JWTConstants.JWT_PARAM_NAME, assertion));
+ if (scopes != null && !scopes.isEmpty()) {
+ params.add(new BasicNameValuePair(JWTConstants.SCOPE_PARAM_NAME, scopes));
+ }
+ String decodedKey[] = getDecodedKey(encodedAppcredential);
+ if (decodedKey.length != 2) {
+ throw new JWTClientException("Invalid app credential");
+ }
+ return getTokenInfo(params, decodedKey[0], decodedKey[1]);
+ }
+
public AccessTokenInfo getAccessToken(String consumerKey, String consumerSecret, String username, String scopes,
Map paramsMap)
throws JWTClientException {
@@ -137,9 +156,12 @@ public class JWTClient {
String accessToken = (String) jsonObject.get(JWTConstants.ACCESS_TOKEN_GRANT_TYPE_PARAM_NAME);
if (accessToken != null && !accessToken.isEmpty()) {
accessTokenInfo.setAccessToken(accessToken);
- accessTokenInfo.setRefreshToken((String) jsonObject.get(JWTConstants.REFRESH_TOKEN_GRANT_TYPE_PARAM_NAME));
+ accessTokenInfo.setRefreshToken((String) jsonObject.get(
+ JWTConstants.REFRESH_TOKEN_GRANT_TYPE_PARAM_NAME));
accessTokenInfo.setExpiresIn((Long) jsonObject.get(JWTConstants.OAUTH_EXPIRES_IN));
accessTokenInfo.setTokenType((String) jsonObject.get(JWTConstants.OAUTH_TOKEN_TYPE));
+ accessTokenInfo.setScopes((String) jsonObject.get(JWTConstants.OAUTH_TOKEN_SCOPE));
+
}
return accessTokenInfo;
} catch (MalformedURLException e) {
@@ -161,7 +183,11 @@ public class JWTClient {
return new String(Base64.encodeBase64((consumerKey + ":" + consumerSecret).getBytes()));
}
- public String getJwtToken(String username) throws JWTClientException {
+ private String[] getDecodedKey(String encodedKey) {
+ return (new String(Base64.decodeBase64((encodedKey).getBytes()))).split(":");
+ }
+
+ public String getJwtToken(String username) throws JWTClientException {
return JWTClientUtil.generateSignedJWTAssertion(username, jwtConfig, isDefaultJWTClient);
}
diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/constant/JWTConstants.java b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/constant/JWTConstants.java
index ab6a4b142d..998813054a 100644
--- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/constant/JWTConstants.java
+++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/constant/JWTConstants.java
@@ -23,6 +23,7 @@ package org.wso2.carbon.identity.jwt.client.extension.constant;
public class JWTConstants {
public static final String OAUTH_EXPIRES_IN = "expires_in";
public static final String OAUTH_TOKEN_TYPE = "token_type";
+ public static final String OAUTH_TOKEN_SCOPE = "scope";
public static final String JWT_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:jwt-bearer";
public static final String GRANT_TYPE_PARAM_NAME = "grant_type";
public static final String REFRESH_TOKEN_GRANT_TYPE = "refresh_token";
diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/dto/AccessTokenInfo.java b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/dto/AccessTokenInfo.java
index c1adb813fd..a0240dc818 100644
--- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/dto/AccessTokenInfo.java
+++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/dto/AccessTokenInfo.java
@@ -27,6 +27,7 @@ public class AccessTokenInfo {
private long expiresIn;
private String refreshToken;
private String accessToken;
+ private String scopes;
public String getTokenType() {
return tokenType;
@@ -59,4 +60,12 @@ public class AccessTokenInfo {
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
+
+ public String getScopes() {
+ return scopes;
+ }
+
+ public void setScopes(String scopes) {
+ this.scopes = scopes;
+ }
}
diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml
index fcb84775bd..623cfc1968 100644
--- a/components/identity-extensions/pom.xml
+++ b/components/identity-extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml
index e4512e9eb1..7c0b63ead6 100644
--- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml
+++ b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
policy-mgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.devicemgt
org.wso2.carbon.complex.policy.decision.point
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - Policy Decision Point
WSO2 Carbon - Policy Decision Point
diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml
index 275b501c22..119e583cbe 100644
--- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml
+++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml
@@ -3,14 +3,14 @@
org.wso2.carbon.devicemgt
policy-mgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.devicemgt
org.wso2.carbon.policy.decision.point
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - Policy Decision Point
WSO2 Carbon - Policy Decision Point
diff --git a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml
index 107db4eb40..73a1f34f6b 100644
--- a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml
+++ b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml
@@ -3,7 +3,7 @@
org.wso2.carbon.devicemgt
policy-mgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
@@ -11,7 +11,7 @@
4.0.0
org.wso2.carbon.devicemgt
org.wso2.carbon.policy.information.point
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - Policy Information Point
WSO2 Carbon - Policy Information Point
diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml
index 90278858b6..8a54d3d981 100644
--- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml
+++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
policy-mgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.devicemgt
org.wso2.carbon.policy.mgt.common
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - Policy Management Common
WSO2 Carbon - Policy Management Common
diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml
index b8d15613c3..a61f6d8fdb 100644
--- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml
+++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
policy-mgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.devicemgt
org.wso2.carbon.policy.mgt.core
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - Policy Management Core
WSO2 Carbon - Policy Management Core
diff --git a/components/policy-mgt/pom.xml b/components/policy-mgt/pom.xml
index 431ccb78e7..ef1d4979d0 100644
--- a/components/policy-mgt/pom.xml
+++ b/components/policy-mgt/pom.xml
@@ -23,13 +23,13 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
policy-mgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Policy Management Component
http://wso2.org
diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml
index 26f3ba3936..5306b93ec5 100644
--- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml
+++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml
@@ -21,14 +21,14 @@
org.wso2.carbon.devicemgt
webapp-authenticator-framework
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.devicemgt
org.wso2.carbon.webapp.authenticator.framework
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
bundle
WSO2 Carbon - Web Application Authenticator Framework Bundle
WSO2 Carbon - Web Application Authenticator Framework Bundle
diff --git a/components/webapp-authenticator-framework/pom.xml b/components/webapp-authenticator-framework/pom.xml
index c838d7e1c6..3c36f84a76 100644
--- a/components/webapp-authenticator-framework/pom.xml
+++ b/components/webapp-authenticator-framework/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
org.wso2.carbon.devicemgt
webapp-authenticator-framework
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Webapp Authenticator Framework
http://wso2.org
diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml
index 10969ec3eb..88c8b7047c 100644
--- a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml
+++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml
@@ -21,14 +21,14 @@
org.wso2.carbon.devicemgt
apimgt-extensions-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.application.extension.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - API Management Application Extension Feature
http://wso2.org
This feature contains an implementation of a api application registration, which takes care of subscription
diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml
index 9176e530fd..03fa4e8c66 100644
--- a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml
+++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
apimgt-extensions-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.handler.server.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Device Management - APIM handler Server Feature
http://wso2.org
This feature contains the handler for the api authentications
diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml
index 212ed5ae90..e6c65be761 100644
--- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml
+++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml
@@ -22,13 +22,13 @@
org.wso2.carbon.devicemgt
apimgt-extensions-feature
- 2.0.12-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.integration.client.feature
- 2.0.12-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - APIM Integration Client Feature
http://wso2.org
diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml
index b20a10d656..88a2f09f0e 100644
--- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml
+++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml
@@ -21,14 +21,14 @@
org.wso2.carbon.devicemgt
apimgt-extensions-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.apimgt.webapp.publisher.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - API Management Webapp Publisher Feature
http://wso2.org
This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing
diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml
index fae0871ed2..1abfb6e9cc 100644
--- a/features/apimgt-extensions/pom.xml
+++ b/features/apimgt-extensions/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
org.wso2.carbon.devicemgt
apimgt-extensions-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - API Management Extensions Feature
http://wso2.org
diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml
index d11567cd8e..af671ac7ea 100644
--- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml
+++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
certificate-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml
index 70d38073cf..6cfc083be2 100644
--- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml
+++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
certificate-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml
index 1c19414ebf..68439fb173 100644
--- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml
+++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
certificate-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.certificate.mgt.server.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Certificate Management Server Feature
http://wso2.org
This feature contains the core bundles required for back-end Certificate Management functionality
diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml
index 590cf2fc95..a81ff5f12d 100644
--- a/features/certificate-mgt/pom.xml
+++ b/features/certificate-mgt/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
org.wso2.carbon.devicemgt
certificate-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Certificate Management Feature
http://wso2.org
diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml
index 608c6278f5..b3a572ea7a 100644
--- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml
+++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Device Type Deployer Feature
http://wso2.org
WSO2 Carbon - Device Type Deployer Feature
diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml
index a16aa580da..4eae138b6b 100644
--- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml
+++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - GCM Based Push Notification Provider Feature
http://wso2.org
WSO2 Carbon - MQTT Based Push Notification Provider Feature
diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml
index 8bb7e725ba..fc4ec610fc 100644
--- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml
+++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - MQTT Based Push Notification Provider Feature
http://wso2.org
WSO2 Carbon - MQTT Based Push Notification Provider Feature
diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml
index 64bbfa055d..f497ba8b0f 100644
--- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml
+++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
device-mgt-extensions-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - XMPP Based Push Notification Provider Feature
http://wso2.org
WSO2 Carbon - XMPP Based Push Notification Provider Feature
diff --git a/features/device-mgt-extensions/pom.xml b/features/device-mgt-extensions/pom.xml
index cd1a75a0b9..35aaca0541 100644
--- a/features/device-mgt-extensions/pom.xml
+++ b/features/device-mgt-extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml
index 22fd593786..4914a14a7d 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml
@@ -3,13 +3,13 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.analytics.dashboard.feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Device Management Dashboard Analytics Feature
WSO2 Carbon - Device Management Dashboard Analytics Feature
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml
index 72bc3b2915..2a0e264eb2 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.analytics.data.publisher.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Device Management Server Feature
http://wso2.org
This feature contains bundles related to device analytics data publisher
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml
index 3f757d8199..6a370c6fa2 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml
index e83b418ef4..83ae359cb6 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml
@@ -4,14 +4,14 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.extensions.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Device Management Extensions Feature
http://wso2.org
This feature contains common extensions used by key device management functionalities
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml
index c4c2cbd900..5e4240db15 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml
index 04adb18c2f..8785d64ade 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.server.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Device Management Server Feature
http://wso2.org
This feature contains the core bundles required for Back-end Device Management functionality
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/cdm-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/cdm-config.xml
index e48531dd83..c747b4354c 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/cdm-config.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/cdm-config.xml
@@ -28,8 +28,8 @@
org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.GCMBasedPushNotificationProvider
-
-
+ org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.MQTTBasedPushNotificationProvider
+ org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.XMPPBasedPushNotificationProvider
https://localhost:9443
@@ -47,11 +47,6 @@
Simple
-
- android
- ios
- windows
-
diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml
index 595bfa1b01..16474eef3f 100644
--- a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml
+++ b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
device-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml
index 0036709663..043171fad0 100644
--- a/features/device-mgt/pom.xml
+++ b/features/device-mgt/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
diff --git a/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml b/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml
index e58d7222a9..edcf58ef63 100644
--- a/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml
+++ b/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml
@@ -23,14 +23,14 @@
org.wso2.carbon.devicemgt
dynamic-client-registration-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.dynamic.client.registration.server.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Dynamic Client Registration Server Feature
http://wso2.org
This feature contains dynamic client registration features
diff --git a/features/dynamic-client-registration/pom.xml b/features/dynamic-client-registration/pom.xml
index 49aec402ea..d52ccbd0bd 100644
--- a/features/dynamic-client-registration/pom.xml
+++ b/features/dynamic-client-registration/pom.xml
@@ -23,14 +23,14 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
org.wso2.carbon.devicemgt
dynamic-client-registration-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Dynamic Client Registration Feature
http://wso2.org
diff --git a/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml b/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml
index 7406fc48d5..ed5495efb9 100644
--- a/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml
+++ b/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
email-sender-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.email.sender.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Email Sender Feature
http://wso2.org
This feature contains the core bundles required for email sender related functionality
diff --git a/features/email-sender/pom.xml b/features/email-sender/pom.xml
index 035f4ffa38..30ce544dcc 100644
--- a/features/email-sender/pom.xml
+++ b/features/email-sender/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
org.wso2.carbon.devicemgt
email-sender-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Email Sender Feature
http://wso2.org
diff --git a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml
index c6fc448bce..dafe2508da 100644
--- a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml
+++ b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml
@@ -23,14 +23,14 @@
org.wso2.carbon.devicemgt
jwt-client-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.identity.jwt.client.extension.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - JWT Client Feature
http://wso2.org
This feature contains jwt client implementation from which we can get a access token using the jwt
diff --git a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties
index 3c38465581..0c9641fa2d 100644
--- a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties
+++ b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties
@@ -19,7 +19,7 @@
#issuer of the JWT
iss=wso2.org/products/iot
-TokenEndpoint=https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token
+TokenEndpoint=https://${iot.gateway.host}:${iot.gateway.https.port}/token?tenantDomain=carbon.super
#audience of JWT claim
#comma seperated values
diff --git a/features/jwt-client/pom.xml b/features/jwt-client/pom.xml
index a360c71400..18878a7993 100644
--- a/features/jwt-client/pom.xml
+++ b/features/jwt-client/pom.xml
@@ -23,13 +23,13 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
jwt-client-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Dynamic Client Registration Feature
http://wso2.org
diff --git a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml
index 5c07d9febe..0c314a96ca 100644
--- a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml
+++ b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml
@@ -23,14 +23,14 @@
org.wso2.carbon.devicemgt
oauth-extensions-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.oauth.extensions.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Device Mgt OAuth Extensions Feature
http://wso2.org
This feature contains devicemgt related OAuth extensions
diff --git a/features/oauth-extensions/pom.xml b/features/oauth-extensions/pom.xml
index 0a02381d6e..d6305fd569 100644
--- a/features/oauth-extensions/pom.xml
+++ b/features/oauth-extensions/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
org.wso2.carbon.devicemgt
oauth-extensions-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Device Management OAuth Extensions Feature
http://wso2.org
diff --git a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml
index a38bea89c0..fc1e66d408 100644
--- a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml
+++ b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml
@@ -23,14 +23,14 @@
org.wso2.carbon.devicemgt
policy-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.policy.mgt.server.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Policy Management Server Feature
http://wso2.org
This feature contains the core bundles required for Back-end Device Management functionality
diff --git a/features/policy-mgt/pom.xml b/features/policy-mgt/pom.xml
index 7b67edcab4..2da4183d62 100644
--- a/features/policy-mgt/pom.xml
+++ b/features/policy-mgt/pom.xml
@@ -23,14 +23,14 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
org.wso2.carbon.devicemgt
policy-mgt-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Policy Management Feature
http://wso2.org
diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml
index 74228c78a0..28f37886c1 100644
--- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml
+++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
webapp-authenticator-framework-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.webapp.authenticator.framework.server.feature
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Webapp Authenticator Framework Server Feature
http://wso2.org
This feature contains the core bundles required for Back-end Device Management functionality
diff --git a/features/webapp-authenticator-framework/pom.xml b/features/webapp-authenticator-framework/pom.xml
index d7c2b863ad..5197994d7a 100644
--- a/features/webapp-authenticator-framework/pom.xml
+++ b/features/webapp-authenticator-framework/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
../../pom.xml
4.0.0
org.wso2.carbon.devicemgt
webapp-authenticator-framework-feature
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
pom
WSO2 Carbon - Webapp Authenticator Framework Feature
http://wso2.org
diff --git a/pom.xml b/pom.xml
index 1f0b7ff783..3e745d19bd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt
carbon-devicemgt
pom
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
WSO2 Carbon - Device Management - Parent
http://wso2.org
WSO2 Connected Device Manager Components
@@ -909,6 +909,11 @@
org.wso2.carbon.identity.oauth.stub
${identity.inbound.auth.oauth.version}
+
+ org.wso2.carbon.identity
+ org.wso2.carbon.identity.oauth2.grant.jwt
+ ${carbon.identity.jwt.grant.version}
+
org.wso2.carbon.identity.framework
org.wso2.carbon.identity.application.authentication.framework
@@ -1156,6 +1161,11 @@
+
+ org.wso2.carbon.commons
+ org.wso2.carbon.application.mgt.stub
+ ${carbon.commons.version}
+
org.wso2.orbit.org.bouncycastle
@@ -1769,7 +1779,8 @@
[5.0.0, 6.0.0)
5.3.1
5.3.0
-
+ 1.0.2
+ [1.0.2, 2.0.0)
[5.7.0, 6.0.0)
[5.2.0, 6.0.0)
@@ -1787,7 +1798,7 @@
1.2.11.wso2v10
- 2.0.15-SNAPSHOT
+ 2.0.16-SNAPSHOT
4.4.8