From 86cfd9cf578c18e2c5de2511f187b4a51bd3b40e Mon Sep 17 00:00:00 2001 From: knoflook Date: Fri, 8 Dec 2023 15:37:09 +0100 Subject: [PATCH] wip: it builds????? --- pom.xml | 4 ++-- ...ava => RegistrationProfileDomainValidation.java} | 4 +--- .../RegistrationProfileWithMailDomainCheck.java | 13 ------------- .../org.keycloak.authentication.FormActionFactory | 5 +++-- 4 files changed, 6 insertions(+), 20 deletions(-) rename src/main/java/com/github/thomasdarimont/keycloak/auth/{CustomRegistrationUserCreation.java => RegistrationProfileDomainValidation.java} (96%) diff --git a/pom.xml b/pom.xml index ff071b7..3a725b7 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - net.micedre.keycloak + com.github.thomasdarimont.keycloak keycloak-mail-whitelisting 1.9-SNAPSHOT @@ -149,4 +149,4 @@ - \ No newline at end of file + diff --git a/src/main/java/com/github/thomasdarimont/keycloak/auth/CustomRegistrationUserCreation.java b/src/main/java/com/github/thomasdarimont/keycloak/auth/RegistrationProfileDomainValidation.java similarity index 96% rename from src/main/java/com/github/thomasdarimont/keycloak/auth/CustomRegistrationUserCreation.java rename to src/main/java/com/github/thomasdarimont/keycloak/auth/RegistrationProfileDomainValidation.java index 57887c4..2971e91 100644 --- a/src/main/java/com/github/thomasdarimont/keycloak/auth/CustomRegistrationUserCreation.java +++ b/src/main/java/com/github/thomasdarimont/keycloak/auth/RegistrationProfileDomainValidation.java @@ -19,7 +19,6 @@ import jakarta.ws.rs.core.MultivaluedMap; import java.util.ArrayList; import java.util.List; // -import com.google.auto.service.AutoService; import org.keycloak.authentication.FormActionFactory; import org.keycloak.authentication.FormContext; import org.keycloak.authentication.forms.RegistrationUserCreation; @@ -27,8 +26,7 @@ import org.keycloak.events.Errors; import org.keycloak.forms.login.LoginFormsProvider; import org.keycloak.models.utils.FormMessage; -@AutoService(FormActionFactory.class) -public class CustomRegistrationUserCreation extends RegistrationUserCreation { +public abstract class RegistrationProfileDomainValidation extends RegistrationUserCreation { protected static final Logger logger = Logger.getLogger(RegistrationProfileDomainValidation.class); protected static final String DEFAULT_DOMAIN_LIST = "example.org"; diff --git a/src/main/java/com/github/thomasdarimont/keycloak/auth/RegistrationProfileWithMailDomainCheck.java b/src/main/java/com/github/thomasdarimont/keycloak/auth/RegistrationProfileWithMailDomainCheck.java index b5cfa3f..da5b477 100644 --- a/src/main/java/com/github/thomasdarimont/keycloak/auth/RegistrationProfileWithMailDomainCheck.java +++ b/src/main/java/com/github/thomasdarimont/keycloak/auth/RegistrationProfileWithMailDomainCheck.java @@ -9,19 +9,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -public class RegistrationProfileWithMailDomainCheck extends RegistrationProfileDomainValidation { - - public static final String PROVIDER_ID = "registration-mail-check-action"; - -import org.keycloak.authentication.FormContext; -import org.keycloak.forms.login.LoginFormsProvider; -import org.keycloak.provider.ProviderConfigProperty; -import org.keycloak.models.AuthenticatorConfigModel; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - public class RegistrationProfileWithMailDomainCheck extends RegistrationProfileDomainValidation { public static final String PROVIDER_ID = "registration-mail-check-action"; diff --git a/src/main/resources/META-INF/services/org.keycloak.authentication.FormActionFactory b/src/main/resources/META-INF/services/org.keycloak.authentication.FormActionFactory index db36c14..157dcfe 100644 --- a/src/main/resources/META-INF/services/org.keycloak.authentication.FormActionFactory +++ b/src/main/resources/META-INF/services/org.keycloak.authentication.FormActionFactory @@ -1,2 +1,3 @@ -net.micedre.keycloak.registration.RegistrationProfileWithMailDomainCheck -net.micedre.keycloak.registration.RegistrationProfileWithDomainBlock +com.thomasdarimont.keycloak.auth.CustomRegistrationUserCreation +com.thomasdarimont.keycloak.auth.RegistrationProfileWithDomainBlock +com.thomasdarimont.keycloak.auth.RegistrationProfileWithMailDomainCheck