diff --git a/model/map/src/main/java/org/keycloak/models/map/role/MapRoleProvider.java b/model/map/src/main/java/org/keycloak/models/map/role/MapRoleProvider.java index 6290241380..0e24bdad7d 100644 --- a/model/map/src/main/java/org/keycloak/models/map/role/MapRoleProvider.java +++ b/model/map/src/main/java/org/keycloak/models/map/role/MapRoleProvider.java @@ -200,7 +200,7 @@ public class MapRoleProvider implements RoleProvider { DefaultModelCriteria mcb = criteria(); mcb = mcb.compare(SearchableFields.REALM_ID, Operator.EQ, realm.getId()) - .compare(SearchableFields.NAME, Operator.ILIKE, name); + .compare(SearchableFields.NAME, Operator.EQ, name); String roleId = tx.read(withCriteria(mcb)) .map(entityToAdapterFunc(realm)) @@ -221,7 +221,7 @@ public class MapRoleProvider implements RoleProvider { DefaultModelCriteria mcb = criteria(); mcb = mcb.compare(SearchableFields.REALM_ID, Operator.EQ, client.getRealm().getId()) .compare(SearchableFields.CLIENT_ID, Operator.EQ, client.getId()) - .compare(SearchableFields.NAME, Operator.ILIKE, name); + .compare(SearchableFields.NAME, Operator.EQ, name); String roleId = tx.read(withCriteria(mcb)) .map(entityToAdapterFunc(client.getRealm()))