From 109b4b42663e52948c948fbcb43c0f330e9a8e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Krau=C3=9F?= Date: Tue, 22 Oct 2024 13:34:17 +0200 Subject: [PATCH] Adds support for default first broker login flow on realm level --- pom.xml | 77 +++++++++++++++++++ .../service/ImportAuthenticationFlowsIT.java | 2 +- 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a2d6792b0..72ff93367 100644 --- a/pom.xml +++ b/pom.xml @@ -677,6 +677,39 @@ ${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportManagedNoDeleteIT.java + + replace-used-authentication-flow-workaround-with-legacy + generate-sources + + copy + + + ${project.basedir}/src/main/java/de/adorsys/keycloak/config/factory/UsedAuthenticationFlowWorkaroundFactory.java.legacy + ${project.basedir}/src/main/java/de/adorsys/keycloak/config/factory/UsedAuthenticationFlowWorkaroundFactory.java + + + + replace-authentication-flow-import-service-with-legacy + generate-sources + + copy + + + ${project.basedir}/src/main/java/de/adorsys/keycloak/config/service/AuthenticationFlowsImportService.java.legacy + ${project.basedir}/src/main/java/de/adorsys/keycloak/config/service/AuthenticationFlowsImportService.java + + + + replace-authentication-flow-import-service-test-with-legacy + generate-sources + + copy + + + ${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java.legacy + ${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java + + @@ -770,6 +803,39 @@ import org.keycloak.representations.userprofile.config.UPConfig; ${project.basedir}/src/test/java/de/adorsys/keycloak/config/test/util/SubGroupUtil.java + + replace-used-authentication-flow-workaround-with-legacy + generate-sources + + copy + + + ${project.basedir}/src/main/java/de/adorsys/keycloak/config/factory/UsedAuthenticationFlowWorkaroundFactory.java.legacy + ${project.basedir}/src/main/java/de/adorsys/keycloak/config/factory/UsedAuthenticationFlowWorkaroundFactory.java + + + + replace-authentication-flow-import-service-with-legacy + generate-sources + + copy + + + ${project.basedir}/src/main/java/de/adorsys/keycloak/config/service/AuthenticationFlowsImportService.java.legacy + ${project.basedir}/src/main/java/de/adorsys/keycloak/config/service/AuthenticationFlowsImportService.java + + + + replace-authentication-flow-import-service-test-with-legacy + generate-sources + + copy + + + ${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java.legacy + ${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java + + replace-keycloakmock-with-legacy generate-sources @@ -1065,6 +1131,17 @@ import org.keycloak.representations.userprofile.config.UPConfig; ${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java + + replace-keycloakmock-with-legacy + generate-sources + + copy + + + ${project.basedir}/src/test/java/de/adorsys/keycloak/config/test/util/KeycloakMock.java.legacy + ${project.basedir}/src/test/java/de/adorsys/keycloak/config/test/util/KeycloakMock.java + + diff --git a/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java b/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java index 53c75b205..7d2cc7528 100644 --- a/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java +++ b/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java @@ -1283,7 +1283,7 @@ void shouldUpdateCustomFirstBrokerLoginFlowWhenSetAsDefault() throws IOException assertThat(realm.getRealm(), is(DEFAULT_FLOW_REALM_NAME)); assertThat(realm.isEnabled(), is(true)); assertThat(realm.getFirstBrokerLoginFlow(), is("my auth flow")); - assertThat(flow.getAuthenticationExecutions().getFirst().getAuthenticator(), is("idp-auto-link")); + assertThat(flow.getAuthenticationExecutions().get(0).getAuthenticator(), is("idp-auto-link")); } private List getExecutionFromFlow(AuthenticationFlowRepresentation flow, String executionAuthenticator) {