diff --git a/model/jpa/src/main/java/org/keycloak/organization/jpa/OrganizationAdapter.java b/model/jpa/src/main/java/org/keycloak/organization/jpa/OrganizationAdapter.java index a664c91eca..f4b9d0e29c 100644 --- a/model/jpa/src/main/java/org/keycloak/organization/jpa/OrganizationAdapter.java +++ b/model/jpa/src/main/java/org/keycloak/organization/jpa/OrganizationAdapter.java @@ -23,7 +23,6 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.Objects; -import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -36,6 +35,7 @@ import org.keycloak.models.jpa.JpaModel; import org.keycloak.models.jpa.entities.OrganizationDomainEntity; import org.keycloak.models.jpa.entities.OrganizationEntity; import org.keycloak.organization.OrganizationProvider; +import org.keycloak.utils.EmailValidationUtil; import java.util.List; @@ -103,7 +103,7 @@ public final class OrganizationAdapter implements OrganizationModel, JpaModel modelMap = domains.stream() - .peek(this::isDomainInUse) + .peek(this::validateDomainRepresentation) .collect(Collectors.toMap(OrganizationDomainModel::getName, Function.identity())); for (OrganizationDomainEntity domainEntity : new HashSet<>(this.entity.getDomains())) { @@ -153,10 +153,23 @@ public final class OrganizationAdapter implements OrganizationModel, JpaModel