From 9c5cd352cc1dd3a60a86b43ec5187f4bc1a944cf Mon Sep 17 00:00:00 2001 From: mposolda Date: Wed, 19 Feb 2014 15:03:32 +0100 Subject: [PATCH 1/3] KEYCLOAK-319 Use keycloak-ds.xml just in WAR distribution --- distribution/appliance-dist/assembly.xml | 3 +++ .../appliance-dist/src/main/xslt/standalone.xsl | 15 +++++++++++++++ .../en/en-US/modules/server-installation.xml | 14 ++++++++------ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/distribution/appliance-dist/assembly.xml b/distribution/appliance-dist/assembly.xml index 97767425c4..1b81f3809e 100755 --- a/distribution/appliance-dist/assembly.xml +++ b/distribution/appliance-dist/assembly.xml @@ -34,6 +34,9 @@ ${project.build.directory}/unpacked/deployments keycloak/standalone/deployments + + keycloak-ds.xml + ${project.build.directory}/unpacked/themes diff --git a/distribution/appliance-dist/src/main/xslt/standalone.xsl b/distribution/appliance-dist/src/main/xslt/standalone.xsl index 676fdf6e56..8f8011b082 100755 --- a/distribution/appliance-dist/src/main/xslt/standalone.xsl +++ b/distribution/appliance-dist/src/main/xslt/standalone.xsl @@ -16,6 +16,21 @@ + + + + + jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE + h2 + + sa + sa + + + + + + diff --git a/docbook/reference/en/en-US/modules/server-installation.xml b/docbook/reference/en/en-US/modules/server-installation.xml index 208928cc49..bcf1e77abd 100755 --- a/docbook/reference/en/en-US/modules/server-installation.xml +++ b/docbook/reference/en/en-US/modules/server-installation.xml @@ -18,7 +18,7 @@ -
+
Appliance Install The @@ -38,7 +38,6 @@ keycloak-appliance-dist-all-1.0-alpha-1/ standalone.bat standalone/deployments/ auth-server.war/ - keycloak-ds.xml adapters/ keycloak-as7-adapter-dist-1.0-alpha-1.zip @@ -63,7 +62,7 @@ keycloak-appliance-dist-all-1.0-alpha-1/ enter in a new password.
-
+
WAR Distribution Installation The @@ -136,9 +135,12 @@ keycloak-war-dist-all-1.0-alpha-1/ Database Configuration The datasource used to store Keycloak data is configured in the .../standalone/deployments/keycloak-ds.xml - file of your Keycloak Server installation. A good thing to delete this file and move its configuration text into the - centrally managed .../standalone/configuration/standalone.xml file. This will allow - you to manage the database connection pool from the Wildfly/JBoss adminstration console. Here's what + file of your Keycloak Server installation if you used or in .../standalone/configuration/standalone.xml + if you used . File keycloak-ds.xml is used in WAR + distribution, so that you have datasource available out of the box and you don't need to edit standalone.xml file. + However a good thing is to always delete the file keycloak-ds.xml and move its configuration text + into the centrally managed standalone.xml file. + This will allow you to manage the database connection pool from the Wildfly/JBoss administration console. Here's what .../standalone/configuration/standalone.xml should look like after you've done this: From 864362f8a21fa592e925f9d58cfa07e8dca5608e Mon Sep 17 00:00:00 2001 From: mposolda Date: Wed, 19 Feb 2014 16:16:15 +0100 Subject: [PATCH 2/3] Added docs section about tested databases --- .../en/en-US/modules/server-installation.xml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/docbook/reference/en/en-US/modules/server-installation.xml b/docbook/reference/en/en-US/modules/server-installation.xml index bcf1e77abd..0c4ec31ea0 100755 --- a/docbook/reference/en/en-US/modules/server-installation.xml +++ b/docbook/reference/en/en-US/modules/server-installation.xml @@ -187,6 +187,65 @@ keycloak-war-dist-all-1.0-alpha-1/ .../standalone/deployments/auth-server.war/WEB-INF/classes/META-INF/persistence.xml. Please see the Hibernate and JPA documentation for more information on tweaking the backend datamodel. +
+ Tested databases + + Here is list of RDBMS databases and corresponding JDBC drivers, which were tested with Keycloak. Note that Hibernate dialect + is usually set automatically according to your database, but in some cases, you must manually set the proper dialect, + as the default dialect may not work correctly. You can setup dialect either by adding property hibernate.dialect + to the persistence.xml file mentioned above or simply by adding system property hibernate.dialect + with corresponding value. For example, if you are using MS-SQL you can start keycloak with command: + + + This command will set system property hibernate.dialect to value org.hibernate.dialect.SQLServer2008Dialect + and this one will take precedence over the value from persistence.xml file. + Tested databases + + + + Database + JDBC driver + Hibernate Dialect + + + + + H2 1.3.161 + H2 1.3.161 + auto + + + MySQL 5.5 + MySQL Connector/J 5.1.25 + auto + + + PostgreSQL 9.2 + JDBC4 Postgresql Driver, Version 9.3-1100 + auto + + + Oracle 11g R1 + Oracle JDBC Driver v11.1.0.7 + auto + + + Microsoft SQL Server 2012 + Microsoft SQL Server JDBC Driver 4.0.2206.100 + org.hibernate.dialect.SQLServer2008Dialect + + + Sybase ASE 15.7 + JDBC(TM)/7.07 ESD #5 (Build 26792)/P/EBF20686 + auto + + + +
+
+
SSL/HTTPS Setup From 5e0c16a3e2741f742e6bc91961a4003714882119 Mon Sep 17 00:00:00 2001 From: mposolda Date: Wed, 19 Feb 2014 17:43:11 +0100 Subject: [PATCH 3/3] KEYCLOAK-321 Allow distribution to use MongoDB model --- .../en/en-US/modules/server-installation.xml | 29 +++++++++++++++++-- server/pom.xml | 16 ++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/docbook/reference/en/en-US/modules/server-installation.xml b/docbook/reference/en/en-US/modules/server-installation.xml index 0c4ec31ea0..0363c1c256 100755 --- a/docbook/reference/en/en-US/modules/server-installation.xml +++ b/docbook/reference/en/en-US/modules/server-installation.xml @@ -197,8 +197,7 @@ keycloak-war-dist-all-1.0-alpha-1/ with corresponding value. For example, if you are using MS-SQL you can start keycloak with command: - +]]> This command will set system property hibernate.dialect to value org.hibernate.dialect.SQLServer2008Dialect and this one will take precedence over the value from persistence.xml file. Tested databases @@ -247,6 +246,32 @@ keycloak-war-dist-all-1.0-alpha-1/ +
+ MongoDB based model + + Keycloak provides MongoDB based model implementation, which means that your identity data will be saved + in MongoDB instead of traditional RDBMS. To setup it, you need to add few system properties when running Keycloak. + First you need to specify that you want to use mongo instead of default jpa model, and you may also specify + host, port and name of mongo database. So you can start keycloak with the command like this: + + Note that when you install MongoDB on your laptop, it's usually on localhost/270717 by default. That's why properties + keycloak.mongo.host and keycloak.mongo.port are not mandatory, but they already have + default values localhost and 27017 . Similarly property keycloak.mongo.db + has default value keycloak for name of underlying database. So the example above could be simplified like: + + If you switch to Mongo model, it could be a good idea to remove RDBMS related stuff from your distribution to reduce startup time and memory footprint. + To do it, you need to: + + Comment/remove datasource KeycloakDS from standalone/configuration/standalone.xml or standalone/deployments/keycloak-ds.xml + Remove file standalone/deployments/auth-server.war/WEB-INF/classes/META-INF/persistence.xml + + +
SSL/HTTPS Setup diff --git a/server/pom.xml b/server/pom.xml index bd3d7ee5c5..3244cecd4a 100755 --- a/server/pom.xml +++ b/server/pom.xml @@ -160,6 +160,22 @@ resteasy-jackson-provider ${resteasy.version} + + + + org.keycloak + keycloak-model-mongo + ${project.version} + + + org.mongodb + mongo-java-driver + + + org.picketlink + picketlink-common + +