Identity and Access Server using Keycloak
This is docker-compose setup for Keycloak server configured with [mysql database) with nginx https termination and lightweight mail server.
- keycloak-postgres, 2.4.0.Final
- [mysql latest]
- nginx configuration for https termination, borrowed from anvilreserach and customized for Keycloak
- mailcatcher
- Clone this repository and run
docker-compose up - In separate shell, run
./add-cert-to-java-truststore.sh. Fix script for your local java setup, idea is to put custom (self-signed) certificate into javacacerts - Add to your
/etc/hostsfile record foridentity.keycloak.openiotreferencing127.0.0.1127.0.0.1 identity.keycloak.openiot
- point your browser to https://identity.keycloak.openiot
- accept insecure site, or add ./keycloak-nginx/certs/identity.keycloak.openiot.cert to browser's truststore
- default admin account added to Keycloak is:
- Username: openiot
- Password: password
- in
standalone.xml, I've modified 2 lines:- line 410:
<http-listener name="default" socket-binding="http" redirect-socket="https" proxy-address-forwarding="true"/>- This modification tells Keycloak to pull the client’s IP address from the X-Forwarded-For header since it's behind nginx.
- line 412:
<host name="default-host" alias="localhost" default-web-module="keycloak-server.war">- This modification deploys Keycloak as default application on root path (context)
- line 410: