Skip to content

Commit

Permalink
Adds support for default first broker login flow on realm level
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilian-krauss committed Nov 15, 2024
1 parent 06d4eac commit 311fc39
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 1 deletion.
77 changes: 77 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,39 @@
<destinationFile>${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportManagedNoDeleteIT.java</destinationFile>
</configuration>
</execution>
<execution>
<id>replace-used-authentication-flow-workaround-with-legacy</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>${project.basedir}/src/main/java/de/adorsys/keycloak/config/factory/UsedAuthenticationFlowWorkaroundFactory.java.legacy</sourceFile>
<destinationFile>${project.basedir}/src/main/java/de/adorsys/keycloak/config/factory/UsedAuthenticationFlowWorkaroundFactory.java</destinationFile>
</configuration>
</execution>
<execution>
<id>replace-authentication-flow-import-service-with-legacy</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>${project.basedir}/src/main/java/de/adorsys/keycloak/config/service/AuthenticationFlowsImportService.java.legacy</sourceFile>
<destinationFile>${project.basedir}/src/main/java/de/adorsys/keycloak/config/service/AuthenticationFlowsImportService.java</destinationFile>
</configuration>
</execution>
<execution>
<id>replace-authentication-flow-import-service-test-with-legacy</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java.legacy</sourceFile>
<destinationFile>${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -770,6 +803,39 @@ import org.keycloak.representations.userprofile.config.UPConfig;</token>
<destinationFile>${project.basedir}/src/test/java/de/adorsys/keycloak/config/test/util/SubGroupUtil.java</destinationFile>
</configuration>
</execution>
<execution>
<id>replace-used-authentication-flow-workaround-with-legacy</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>${project.basedir}/src/main/java/de/adorsys/keycloak/config/factory/UsedAuthenticationFlowWorkaroundFactory.java.legacy</sourceFile>
<destinationFile>${project.basedir}/src/main/java/de/adorsys/keycloak/config/factory/UsedAuthenticationFlowWorkaroundFactory.java</destinationFile>
</configuration>
</execution>
<execution>
<id>replace-authentication-flow-import-service-with-legacy</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>${project.basedir}/src/main/java/de/adorsys/keycloak/config/service/AuthenticationFlowsImportService.java.legacy</sourceFile>
<destinationFile>${project.basedir}/src/main/java/de/adorsys/keycloak/config/service/AuthenticationFlowsImportService.java</destinationFile>
</configuration>
</execution>
<execution>
<id>replace-authentication-flow-import-service-test-with-legacy</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java.legacy</sourceFile>
<destinationFile>${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java</destinationFile>
</configuration>
</execution>
<execution>
<id>replace-keycloakmock-with-legacy</id>
<phase>generate-sources</phase>
Expand Down Expand Up @@ -1065,6 +1131,17 @@ import org.keycloak.representations.userprofile.config.UPConfig;</token>
<destinationFile>${project.basedir}/src/test/java/de/adorsys/keycloak/config/service/ImportAuthenticationFlowsIT.java</destinationFile>
</configuration>
</execution>
<execution>
<id>replace-keycloakmock-with-legacy</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>${project.basedir}/src/test/java/de/adorsys/keycloak/config/test/util/KeycloakMock.java.legacy</sourceFile>
<destinationFile>${project.basedir}/src/test/java/de/adorsys/keycloak/config/test/util/KeycloakMock.java</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,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<AuthenticationExecutionExportRepresentation> getExecutionFromFlow(AuthenticationFlowRepresentation flow, String executionAuthenticator) {
Expand Down

0 comments on commit 311fc39

Please sign in to comment.