Skip to content

Instantly share code, notes, and snippets.


Niko Köbler dasniko

View GitHub Profile
dasniko /
Last active March 4, 2023 23:43
How to configure a Keycloak cluster properly (Quarkus edition)

Keycloak Cluster Configuration (How to)

This is a short and simple example on how to build a proper Keycloak cluster, using DNS_PING as discovery protocol and an NGINX server as reverse proxy.

To get it working properly, just enable Docker Swarm mode with docker swarm init and just run it as it were a regular Docker Compose deployment. So, just docker compose up is enough, don't deploy a swarm stack! (This would cause trouble and extra complexity with networking)
Afterwards, you can disable Swarm again with docker swarm leave -f, if needed.

dasniko /
Last active March 7, 2023 11:20
Creating self signed tls certificates with self-signed root CA
dasniko /
Last active February 2, 2023 10:35
How to configure a keycloak cluster properly (legacy Wildfly edition)

Keycloak Cluster Configuration (How to) - Legacy Wildfly Distribution!!!

This is a short and simple example on how to build a proper Keycloak cluster, using JDBC_PING as discovery protocol and an NGINX server as reverse proxy.

Please see also my video about Keycloak Clustering:

dasniko / keycloak-json-logging.cli
Created January 9, 2021 14:30
Log in JSON format for Keycloak/Wildfly server.
View keycloak-json-logging.cli
embed-server --server-config=standalone.xml --std-out=echo
dasniko /
Last active December 18, 2020 11:55
How to log Keycloak authentication related events...

Keycloak Events Logging CLI commands

The default Keycloak jboss-logging events listener logs the SUCCESS-events on level DEBUG and all ERROR-events on level WARN. The default logging level of the root logger is INFO, so the SUCCESS-events won't occur in the log output.

To change this and to be able to read all the events in the log output, there are 2 options (choose one of them!):

  1. Change log level of the category logger:
View init_kc_in_body.html
<script src="keycloak.js"></script>
<!-- your usual content goes here... -->
var keycloak = new Keycloak({
url: 'http://localhost:8080/auth',
realm: 'demo',
package dasniko.util;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
* @author Niko Köbler,, @dasniko
public class ToStringUtil {
dasniko /
Created October 28, 2017 20:26

Keybase proof

I hereby claim:

  • I am dasniko on github.
  • I am dasniko ( on keybase.
  • I have a public key ASAIPZokcnTYoxb9pRpue-YRXawuvDpwpX7mc_Qp_6gLuQo

To claim this, I am signing this object:

dasniko /
Last active October 17, 2016 07:46
My favourite JavaScript tools

My favourite JavaScript tools

This list is subject to change at any time, just as tools an my personal view changes.
Additionally, these are just my the ones I prefer, does not mean that I don't know nor like others!

Programming Languages

  • JavaScript in ECMAScript 2015 (ES6) or higher
    • ES5 only if really needed, as you always can use Babel
  • TypeScript
dasniko / nashorn-polyfill.js
Last active May 28, 2018 15:40
necessary JavaScript polyfills for working with Nashorn JS-engine
View nashorn-polyfill.js
var global = this;
var window = this;
var process = {env: {}};
var console = {};
console.debug = print;
console.warn = print;
console.log = print;