diff --git a/server-spi-private/src/main/java/org/keycloak/events/admin/ResourceType.java b/server-spi-private/src/main/java/org/keycloak/events/admin/ResourceType.java index ce2359f280..6198cfe07a 100644 --- a/server-spi-private/src/main/java/org/keycloak/events/admin/ResourceType.java +++ b/server-spi-private/src/main/java/org/keycloak/events/admin/ResourceType.java @@ -148,6 +148,11 @@ public enum ResourceType { */ , CLIENT_SCOPE_MAPPING + /** + * + */ + , CLIENT_SCOPE_CLIENT_MAPPING + /** * */ diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java index b72267cc3d..968d1a6d6d 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/ClientResource.java @@ -332,8 +332,8 @@ public class ClientResource { } client.addClientScope(clientScope, defaultScope); - final ClientRepresentation rep = ModelToRepresentation.toRepresentation(client, session); - adminEvent.operation(OperationType.UPDATE).resource(ResourceType.CLIENT).resourcePath(session.getContext().getUri()).representation(rep).success(); + final ClientScopeRepresentation rep = ModelToRepresentation.toRepresentation(clientScope, session); + adminEvent.operation(OperationType.CREATE).resource(ResourceType.CLIENT_SCOPE_CLIENT_MAPPING).resourcePath(session.getContext().getUri()).representation(rep).success(); } @@ -349,8 +349,8 @@ public class ClientResource { } client.removeClientScope(clientScope); - final ClientRepresentation rep = ModelToRepresentation.toRepresentation(client, session); - adminEvent.operation(OperationType.UPDATE).resource(ResourceType.CLIENT).resourcePath(session.getContext().getUri()).representation(rep).success(); + final ClientScopeRepresentation rep = ModelToRepresentation.toRepresentation(clientScope, session); + adminEvent.operation(OperationType.DELETE).resource(ResourceType.CLIENT_SCOPE_CLIENT_MAPPING).resourcePath(session.getContext().getUri()).representation(rep).success(); }