Skip to content

Instantly share code, notes, and snippets.

Avatar

Niko Köbler dasniko

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

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
dasniko / create_x509_certs.md
Last active March 7, 2023 11:20
Creating self signed tls certificates with self-signed root CA
View create_x509_certs.md
@dasniko
dasniko / _keycloak-cluster-config.md
Last active February 2, 2023 10:35
How to configure a keycloak cluster properly (legacy Wildfly edition)
View _keycloak-cluster-config.md

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: http://www.youtube.com/watch?v=P96VQkBBNxU

@dasniko
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
/subsystem=logging/json-formatter=JSON/:add
/subsystem=logging/console-handler=CONSOLE/:write-attribute(name=named-formatter,value=JSON)
stop-embedded-server
@dasniko
dasniko / keycloak-events-logging-cli.md
Last active December 18, 2020 11:55
How to log Keycloak authentication related events...
View keycloak-events-logging-cli.md

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 org.keycloak.events category logger:
View init_kc_in_body.html
<html>
<head>
<script src="keycloak.js"></script>
</head>
<body>
<!-- your usual content goes here... -->
<script>
var keycloak = new Keycloak({
url: 'http://localhost:8080/auth',
realm: 'demo',
View ToStringUtil.java
package dasniko.util;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
/**
* @author Niko Köbler, https://www.n-k.de, @dasniko
*/
public class ToStringUtil {
@dasniko
dasniko / keybase.md
Created October 28, 2017 20:26
keybase.md
View keybase.md

Keybase proof

I hereby claim:

  • I am dasniko on github.
  • I am dasniko (https://keybase.io/dasniko) on keybase.
  • I have a public key ASAIPZokcnTYoxb9pRpue-YRXawuvDpwpX7mc_Qp_6gLuQo

To claim this, I am signing this object:

@dasniko
dasniko / tools.md
Last active October 17, 2016 07:46
My favourite JavaScript tools
View tools.md

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
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;