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
Added emailNotifitionsEnabled and pushNotifitionsEnabled as User attributes
Michael Rademakerda7fe6293b76
diff --git a/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.java b/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.javaindex 333e19bbf..ebc656e58 100644--- a/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.java+++ b/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.java@@ -86,6 +86,8 @@ public class ManagerKeycloakIdentityProvider extends KeycloakIdentityProvider impublic static final String KEYCLOAK_GRANT_FILE = "KEYCLOAK_GRANT_FILE";public static final String KEYCLOAK_GRANT_FILE_DEFAULT = "manager/build/keycloak.json";public static final String KEYCLOAK_DEFAULT_ROLES_PREFIX = "default-roles-";+ public static final String KEYCLOAK_USER_ATTRIBUTE_EMAIL_NOTIFICATIONS_ENABLED = "emailNotifitionsEnabled";+ public static final String KEYCLOAK_USER_ATTRIBUTE_PUSH_NOTIFICATIONS_ENABLED = "pushNotifitionsEnabled";protected PersistenceService persistenceService;protected TimerService timerService;@@ -236,6 +238,14 @@ public class ManagerKeycloakIdentityProvider extends KeycloakIdentityProvider im}}+ if (!user.getAttributes().containsKey(KEYCLOAK_USER_ATTRIBUTE_EMAIL_NOTIFICATIONS_ENABLED)) {+ user.setAttribute(KEYCLOAK_USER_ATTRIBUTE_EMAIL_NOTIFICATIONS_ENABLED,"true");+ }++ if (!user.getAttributes().containsKey(KEYCLOAK_USER_ATTRIBUTE_PUSH_NOTIFICATIONS_ENABLED)) {+ user.setAttribute(KEYCLOAK_USER_ATTRIBUTE_PUSH_NOTIFICATIONS_ENABLED, "true");+ }+// For service users we don't actually create the user - keycloak does that when the client is createdif (isUpdate) {