From c0a0f66870e6f4c38dc3a336f1f8b783f4c911ca Mon Sep 17 00:00:00 2001 From: Yuriy M <95305560+yuremm@users.noreply.github.com> Date: Thu, 15 Dec 2022 18:49:12 +0300 Subject: [PATCH] fix: user attributes not updated #2753 (#3326) Co-authored-by: Yuriy Movchan --- .../io/jans/as/server/service/ClientService.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/jans-auth-server/server/src/main/java/io/jans/as/server/service/ClientService.java b/jans-auth-server/server/src/main/java/io/jans/as/server/service/ClientService.java index 0344f111242..99116bf2a84 100644 --- a/jans-auth-server/server/src/main/java/io/jans/as/server/service/ClientService.java +++ b/jans-auth-server/server/src/main/java/io/jans/as/server/service/ClientService.java @@ -74,9 +74,24 @@ public class ClientService { private StaticConfiguration staticConfiguration; public void persist(Client client) { + ignoreCustomObjectClassesForNonLDAP(client); ldapEntryManager.persist(client); } + + private Client ignoreCustomObjectClassesForNonLDAP(Client client) { + String persistenceType = ldapEntryManager.getPersistenceType(); + log.debug("persistenceType: {}", persistenceType); + if (!PersistenceEntryManager.PERSITENCE_TYPES.ldap.name().equals(persistenceType)) { + log.debug( + "Setting CustomObjectClasses :{} to null as it's used only for LDAP and current persistenceType is {} ", + client.getCustomObjectClasses(), persistenceType); + client.setCustomObjectClasses(null); + } + + return client; + } + public void merge(Client client) { ldapEntryManager.merge(client); removeFromCache(client);