Keycloak Maven SDK for managing the entire lifecycle of your extensions with Docker
Clone or download
OpenPj Merge pull request #3 from flashboss/master
upgrade to keycloak 4.7.0.Final
Latest commit fc360bc Dec 11, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
keycloak-assembly first commit Sep 25, 2018
keycloak-identity-providers first commit Sep 25, 2018
keycloak-integration-tests first commit Sep 25, 2018
keycloak-theme first commit Sep 25, 2018
src/main first commit Sep 25, 2018
.dockerignore first commit Sep 25, 2018
.gitignore first commit Sep 25, 2018
.maven-dockerignore first commit Sep 25, 2018
Dockerfile upgrade to keycloak 4.7.0.Final Dec 7, 2018
LICENSE.txt first commit Sep 25, 2018 Update Sep 25, 2018
pom.xml upgrade to keycloak 4.7.0.Final Dec 7, 2018

Keycloak Docker Quickstart

This project is aimed to manage Keycloak extensions using a fully Maven lifecycle. The current supported component are the following:

  • keycloak-assembly
  • keycloak-identity-providers
  • keycloak-integration-tests
  • keycloak-theme

Developed and tested on Keycloak 4.0.0.Final.


In order to use this project, you need to install the following components:

  • Apache Maven 3.5.x
  • Docker

Keycloak Assembly

This is the Maven assembly module for deploying the platform in any environment that is not currently supporting Docker. The final artifact for this module is a folder tree as the following:

  • realm-config
  • standalone
  • themes

Keycloak Identity Providers

Main module that includes all the needed custom providers and authenticators. The default project contains only a single custom authenticator but you can easily add new providers following the same configuration approach.

Custom Authenticator This is the implementation of the secret question provider taken from the Keycloak examples folder.

Keycloak Integration Tests

This module will install and run all the artifacts using Docker. It can include also your own code for integration tests after executing your custom image.


mvn clean package

This will also regenerate the Dockerfile in the project root.

Running Integration Tests

To execute integration tests you can run the following command:

mvn clean integration-test

A specific Maven property (docker.keepRunning) is provided to decide if keep running the container after the execution of tests or not. Please consider that the default value is true, this means that you have to manually stop the container after executing integration-test.

Saving and running the Custom Keycloak Docker image

In order to execute the build process locally of the Docker image custom/keycloak:latest

mvn clean package
mvn install

After the startup of Keycloak, you can access as admin/admin from the admin console URL:


A quickstart realm is provided to test your extensions.

To dinamically regenerate the Dockerfile and build only the Docker image:

mvn clean package
docker build -t custom/keycloak:${project.version} .

Run the latest Docker image:

docker run -p 8080:8080 custom/keycloak:latest

Keycloak Themes

This module includes the default example of themes with the addition of the secret question sample templates taken from the default authenticator.



Source Target deployment Artifact
/src/main/resources/standalone/configuration/standalone.xml /opt/jboss/keycloak/standalone/configuration/standalone.xml XML
/src/main/realm-config /opt/jboss/keycloak/realm-config Folder
/keycloak-theme/target/keycloak-theme-${project.version}.jar /opt/jboss/keycloak/standalone/deployments JAR
/keycloak-identity-providers/keycloak-identity-provider-authenticator/target/keycloak-identity-provider-authenticator-${project.version}.jar /opt/jboss/keycloak/standalone/deployments JAR

Docker image The Docker image is written inside your local repo but it is also available in the following path: