Skip to content

Keycloak Setup

pace edited this page Nov 5, 2020 · 2 revisions

Prerequisites

  • Java - 8+
  • Git
  • Docker
  • Docker-compose
  • Maven 3.1.1(or newer)
  • Keycloak - 4.7.0(Supported by our services)

Keycloak is an Open Source Identity and Access Management for modern Applications and Services. For more information about Keycloak visit the Keycloak homepage and Keycloak blog.

Keycloak Supports PostgreSQL, MySQL, Oracle, mssql and mariadb, Below is an example to setup the keycloak with PostgreSQL.

Note: Use Keycloak - 4.7.0 to be supported by our services, Any recent version can run into some issues in our services.

Running Keycloak Server

First clone the Keycloak repository:

git clone https://github.com/keycloak/keycloak.git
cd keycloak
git checkout tags/4.7.0 -b <branch_name>

To build Keycloak run:

mvn install

This will build all modules and run the testsuite.

To build the distribution run:

mvn install -Pdistribution

Once completed you will find distribution archives in distribution.

To build only the server run:

mvn -Pdistribution -pl distribution/server-dist -am -Dmaven.test.skip clean install

Starting Keycloak

To start Keycloak during development first build as specified above, then run:

mvn -f testsuite/utils/pom.xml exec:java -Pkeycloak-server 

When running testsuite, by default an account with username admin and password admin will be created within the master realm at start.

To start Keycloak from the server distribution first build the distribution it as specified above, then run:

tar xfz distribution/server-dist/target/keycloak-<VERSION>.tar.gz
cd keycloak-<VERSION>
bin/standalone.sh

Open http://localhost:8080/auth and login as user 'admin' with password 'admin'.

To stop the server press Ctrl + C.

To run keycloak with other databases like MySQL, Oracle, mssql and mariadb check here and check the Keycloak documentation Githubfor more information.