diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/assembly.xml b/distribution/server-overlay/eap6/eap6-server-overlay/assembly.xml index 83ee9e315a..580b1d7ef7 100755 --- a/distribution/server-overlay/eap6/eap6-server-overlay/assembly.xml +++ b/distribution/server-overlay/eap6/eap6-server-overlay/assembly.xml @@ -20,6 +20,13 @@ **/** + @@ -45,14 +52,6 @@ src/main/providers/README.txt standalone/configuration/providers - - cli/keycloak-prepare.cli - bin - - - cli/keycloak-install.cli - bin - diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install.cli b/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install.cli index 59ed0529c3..cc594313f9 100644 --- a/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install.cli +++ b/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install.cli @@ -1,10 +1,2 @@ -/subsystem=datasources/data-source=KeycloakDS/:add(connection-url="jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE",driver-name=h2,jndi-name=java:jboss/datasources/KeycloakDS,password=sa,user-name=sa,use-java-context=true,enabled=true) -/subsystem=logging/logger=org.jboss.resteasy.resteasy_jaxrs.i18n/:add(level=ERROR) -/subsystem=infinispan/cache-container=keycloak:add(jndi-name="infinispan/Keycloak",start="EAGER") -/subsystem=infinispan/cache-container=keycloak/local-cache=realms:add() -/subsystem=infinispan/cache-container=keycloak/local-cache=users:add() -/subsystem=infinispan/cache-container=keycloak/local-cache=sessions:add() -/subsystem=infinispan/cache-container=keycloak/local-cache=loginFailures:add() -:shutdown(restart=true) /extension=org.keycloak.keycloak-server-subsystem/:add(module=org.keycloak.keycloak-server-subsystem) /subsystem=keycloak-server:add(web-context=auth) \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install-ha.cli b/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-prepare-ha.cli similarity index 79% rename from distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install-ha.cli rename to distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-prepare-ha.cli index 6f91806c8f..edcd1c6ab6 100644 --- a/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install-ha.cli +++ b/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-prepare-ha.cli @@ -5,7 +5,4 @@ /subsystem=infinispan/cache-container=keycloak/invalidation-cache=realms:add(mode="SYNC") /subsystem=infinispan/cache-container=keycloak/invalidation-cache=users:add(mode="SYNC") /subsystem=infinispan/cache-container=keycloak/distributed-cache=sessions:add(mode="SYNC",owners="1") -/subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures:add(mode="SYNC",owners="1") -:shutdown(restart=true) -/extension=org.keycloak.keycloak-server-subsystem/:add(module=org.keycloak.keycloak-server-subsystem) -/subsystem=keycloak-server:add(web-context=auth) \ No newline at end of file +/subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures:add(mode="SYNC",owners="1") \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-prepare.cli b/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-prepare.cli new file mode 100644 index 0000000000..191cb284cf --- /dev/null +++ b/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-prepare.cli @@ -0,0 +1,7 @@ +/subsystem=datasources/data-source=KeycloakDS/:add(connection-url="jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE",driver-name=h2,jndi-name=java:jboss/datasources/KeycloakDS,password=sa,user-name=sa,use-java-context=true,enabled=true) +/subsystem=logging/logger=org.jboss.resteasy.resteasy_jaxrs.i18n/:add(level=ERROR) +/subsystem=infinispan/cache-container=keycloak:add(jndi-name="infinispan/Keycloak",start="EAGER") +/subsystem=infinispan/cache-container=keycloak/local-cache=realms:add() +/subsystem=infinispan/cache-container=keycloak/local-cache=users:add() +/subsystem=infinispan/cache-container=keycloak/local-cache=sessions:add() +/subsystem=infinispan/cache-container=keycloak/local-cache=loginFailures:add() \ No newline at end of file diff --git a/distribution/server-overlay/wf9-server-overlay/assembly.xml b/distribution/server-overlay/wf9-server-overlay/assembly.xml index 080671d5ad..0427f802ff 100755 --- a/distribution/server-overlay/wf9-server-overlay/assembly.xml +++ b/distribution/server-overlay/wf9-server-overlay/assembly.xml @@ -47,7 +47,13 @@ - + @@ -65,10 +71,6 @@ ${project.build.directory}/unpacked/keycloak-${project.version}/standalone/configuration/keycloak-server.json standalone/configuration - - cli/keycloak-install.cli - bin - diff --git a/distribution/server-overlay/wf9-server-overlay/cli/keycloak-install.cli b/distribution/server-overlay/wf9-server-overlay/cli/keycloak-install.cli index 6de3e24b1e..cc594313f9 100644 --- a/distribution/server-overlay/wf9-server-overlay/cli/keycloak-install.cli +++ b/distribution/server-overlay/wf9-server-overlay/cli/keycloak-install.cli @@ -1,9 +1,2 @@ -/subsystem=datasources/data-source=KeycloakDS/:add(connection-url="jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE",driver-name=h2,jndi-name=java:jboss/datasources/KeycloakDS,password=sa,user-name=sa,use-java-context=true) -/subsystem=infinispan/cache-container=keycloak:add(jndi-name="infinispan/Keycloak") -/subsystem=infinispan/cache-container=keycloak/local-cache=realms:add() -/subsystem=infinispan/cache-container=keycloak/local-cache=users:add() -/subsystem=infinispan/cache-container=keycloak/local-cache=sessions:add() -/subsystem=infinispan/cache-container=keycloak/local-cache=loginFailures:add() -:shutdown(restart=true) /extension=org.keycloak.keycloak-server-subsystem/:add(module=org.keycloak.keycloak-server-subsystem) /subsystem=keycloak-server:add(web-context=auth) \ No newline at end of file diff --git a/distribution/server-overlay/wf9-server-overlay/cli/keycloak-install-ha.cli b/distribution/server-overlay/wf9-server-overlay/cli/keycloak-prepare-ha.cli similarity index 77% rename from distribution/server-overlay/wf9-server-overlay/cli/keycloak-install-ha.cli rename to distribution/server-overlay/wf9-server-overlay/cli/keycloak-prepare-ha.cli index c26baf7f95..5cfae3876a 100644 --- a/distribution/server-overlay/wf9-server-overlay/cli/keycloak-install-ha.cli +++ b/distribution/server-overlay/wf9-server-overlay/cli/keycloak-prepare-ha.cli @@ -4,7 +4,4 @@ /subsystem=infinispan/cache-container=keycloak/invalidation-cache=realms:add(mode="SYNC") /subsystem=infinispan/cache-container=keycloak/invalidation-cache=users:add(mode="SYNC") /subsystem=infinispan/cache-container=keycloak/distributed-cache=sessions:add(mode="SYNC",owners="1") -/subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures:add(mode="SYNC",owners="1") -:shutdown(restart=true) -/extension=org.keycloak.keycloak-server-subsystem/:add(module=org.keycloak.keycloak-server-subsystem) -/subsystem=keycloak-server:add(web-context=auth) \ No newline at end of file +/subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures:add(mode="SYNC",owners="1") \ No newline at end of file diff --git a/distribution/server-overlay/wf9-server-overlay/cli/keycloak-prepare.cli b/distribution/server-overlay/wf9-server-overlay/cli/keycloak-prepare.cli new file mode 100644 index 0000000000..dcad93a2d9 --- /dev/null +++ b/distribution/server-overlay/wf9-server-overlay/cli/keycloak-prepare.cli @@ -0,0 +1,6 @@ +/subsystem=datasources/data-source=KeycloakDS/:add(connection-url="jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE",driver-name=h2,jndi-name=java:jboss/datasources/KeycloakDS,password=sa,user-name=sa,use-java-context=true) +/subsystem=infinispan/cache-container=keycloak:add(jndi-name="infinispan/Keycloak") +/subsystem=infinispan/cache-container=keycloak/local-cache=realms:add() +/subsystem=infinispan/cache-container=keycloak/local-cache=users:add() +/subsystem=infinispan/cache-container=keycloak/local-cache=sessions:add() +/subsystem=infinispan/cache-container=keycloak/local-cache=loginFailures:add() \ No newline at end of file diff --git a/docbook/auth-server-docs/reference/en/en-US/modules/server-installation.xml b/docbook/auth-server-docs/reference/en/en-US/modules/server-installation.xml index 2f7a23a139..9c78f3a4bf 100755 --- a/docbook/auth-server-docs/reference/en/en-US/modules/server-installation.xml +++ b/docbook/auth-server-docs/reference/en/en-US/modules/server-installation.xml @@ -59,30 +59,23 @@ (username: admin and password: admin). Keycloak will then prompt you to enter in a new password. - +
Install on existing JBoss EAP 6.4.0.GA Same procedure as WildFly 9.0.0.Final, but download keycloak-overlay-eap6-&project.version;.zip or keycloak-overlay-eap6-&project.version;.tar.gz. - - However, for EAP, adding Keycloak to other sever configurations (standalone.xml, standalone-ha.xml, etc.) requires two CLI scripts. Start the server with - the desired server-config. Then execute the following CLI scripts with a restart in between: - - - <EAP_HOME>/bin/jboss-cli.sh -c --file=keycloak-prepare.cli - - Restart the server with the same server-config. - - <EAP_HOME>/bin/jboss-cli.sh -c --file=keycloak-install.cli - - -
Install Development Bundle diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java b/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java index 4b523a16c9..1d441ece5f 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java @@ -22,6 +22,7 @@ import org.keycloak.models.RequiredActionProviderModel; import org.keycloak.provider.ProviderConfigProperty; import org.keycloak.provider.ProviderFactory; import org.keycloak.representations.idm.ConfigPropertyRepresentation; +import org.keycloak.services.ErrorResponse; import org.keycloak.utils.CredentialHelper; import javax.ws.rs.Consumes; @@ -277,7 +278,7 @@ public class AuthenticationManagementResource { this.auth.requireManage(); if (realm.getFlowByAlias(model.getAlias()) != null) { - return Response.status(Response.Status.CONFLICT).build(); + return ErrorResponse.exists("Flow " + model.getAlias() + " already exists"); } realm.addAuthenticationFlow(model);