100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Bug fixes for when using BASIC identity provider
Rich Turneraf24f0b31cc7
diff --git a/client/src/main/resources/org/openremote/app/client/i18n/ManagerMessages.properties b/client/src/main/resources/org/openremote/app/client/i18n/ManagerMessages.propertiesindex 5e6312a0d..019e9cc9a 100644--- a/client/src/main/resources/org/openremote/app/client/i18n/ManagerMessages.properties+++ b/client/src/main/resources/org/openremote/app/client/i18n/ManagerMessages.properties@@ -222,6 +222,7 @@ attributeValueType[FLOW]=Flow rateattributeValueType[DIRECTION]=DirectionattributeValueType[GEO_JSON_POINT]=CoordinatesattributeValueType[EMAIL]=Email+attributeValueType[RULES_TEMPLATE_FILTER]=Rules template filterattributeValueType[ASSET_STATUS]=Asset statusattributeValueType[CALENDAR_EVENT]=Calendar eventvalidationFailureOnAttribute=Attribute error on ''{0}''diff --git a/client/src/main/webapp/index.html b/client/src/main/webapp/index.htmlindex 8655beeca..b4964a6f1 100644--- a/client/src/main/webapp/index.html+++ b/client/src/main/webapp/index.html@@ -36,7 +36,7 @@return (url, resourceType) => {return {url: url,- headers: {Authorization: 'Bearer ' + security.keycloak.token}+ headers: {Authorization: security.getAuthHeader()}}};};diff --git a/client/src/main/webapp/src/or-app/or-app-security.html b/client/src/main/webapp/src/or-app/or-app-security.htmlindex f588a5343..c633fc1fd 100644--- a/client/src/main/webapp/src/or-app/or-app-security.html+++ b/client/src/main/webapp/src/or-app/or-app-security.html@@ -275,6 +275,14 @@return this.authenticated && this.realm === "master" && this.hasRealmRole("admin");}+ getAuthHeader() {+ if (this.keycloak) {+ return 'Bearer ' + security.keycloak.token;+ } else {+ return "Basic " + btoa(this.user + ":" + this.basicAuthPassword);+ }+ }+hasRealmRole(role) {if (!this.authenticated) {return false;@@ -493,7 +501,7 @@performBasicAuthentication() {try {// Send a request with credentials to a resource that we know returns 200 or 401- let url = "/" + this.realm + "/asset/user/current";+ let url = "/api/" + this.realm + "/asset/user/current";let request = new XMLHttpRequest();diff --git a/manager/src/main/java/org/openremote/manager/map/MapResourceImpl.java b/manager/src/main/java/org/openremote/manager/map/MapResourceImpl.javaindex f399dd897..925c5c94e 100644--- a/manager/src/main/java/org/openremote/manager/map/MapResourceImpl.java+++ b/manager/src/main/java/org/openremote/manager/map/MapResourceImpl.java@@ -42,7 +42,7 @@ public class MapResourceImpl extends WebResource implements MapResource {public ObjectValue getSettings(RequestParams requestParams) {return mapService.getMapSettings(getRequestRealm(),- identityService.getExternalServerUri().clone()+ requestParams.uriInfo.getRequestUriBuilder());}@@ -50,7 +50,7 @@ public class MapResourceImpl extends WebResource implements MapResource {public ObjectValue getSettingsJs(RequestParams requestParams) {return mapService.getMapSettingsJs(getAuthenticatedRealm(),- identityService.getExternalServerUri().clone()+ requestParams.uriInfo.getRequestUriBuilder());}diff --git a/manager/src/main/java/org/openremote/manager/map/MapService.java b/manager/src/main/java/org/openremote/manager/map/MapService.javaindex c053c4cd0..eb16346c3 100644--- a/manager/src/main/java/org/openremote/manager/map/MapService.java+++ b/manager/src/main/java/org/openremote/manager/map/MapService.java@@ -293,6 +293,7 @@ public class MapService implements ContainerService {ArrayValue tilesArray = Values.createArray();String tileUrl = baseUriBuilder.clone().replacePath(API_PATH).path(realm).path("map/tile").build().toString() + "/{z}/{x}/{y}";+ //String tileUrl = UriBuilder.fromPath("/").path(API_PATH).path(realm).path("map/tile").build().toString() + "/{z}/{x}/{y}";tilesArray.set(0, tileUrl);vectorTilesObj.put("tiles", tilesArray);