Dies ist eine alte Version des Dokuments!
Keycloak Basis Dokumentation
Keycloak 18 = Quarkus (aktuell)
Keycloak 16 Wildfly (deprecated). Migration: https://www.keycloak.org/migration/migrating-to-quarkus
Weitere Doku:
Initialer Setup mit Quarkus: Setzen des Admin/PW für den Master Realm über envrironment variablen vor dem ersten Start. Die Variable wird dann in die Postgres DB rein geschrieben. Weitere Administration danach über das Web UI oderper kcadm.sh
root@kc1:/opt/keycloak# export KEYCLOAK_ADMIN=admin root@kc1:/opt/keycloak# echo $KEYCLOAK_ADMIN admin root@kc1:/opt/keycloak# export KEYCLOAK_ADMIN_PASSWORD=xxxx root@kc1:/opt/keycloak# echo KEYCLOAK_ADMIN_PASSWORD KEYCLOAK_ADMIN_PASSWORD root@kc1:/opt/keycloak# ./bin/kc.sh start
Keycloak behind load balancer
https://www.keycloak.org/docs/latest/server_installation/#_setting-up-a-load-balancer-or-proxy
Mit Haproxy: Config proxy=edge. In Haproxy muss X-Forwarded-For gesetzt sein:
backend login-backend option forwardfor server login.netzwissen.de 10.10.10.20:8080 check verify none http-request set-header X-Forwarded-Port %[dst_port] http-request add-header X-Forwarded-Proto https if { ssl_fc } http-request add-header X-Forwarded-For %[src] ## HSTS header, 16000000 seconds: a bit more than 6 months http-response set-header Strict-Transport-Security "max-age=16000000; includeSubDomains; preload;"
Keycloak connected to Postgresql
https://www.tutorialsbuddy.com/keycloak-postgresql-setup
Wichtig: Keycloak DB braucht UTF8 encoding, nicht den SQL_ASCII Standard.