Skip to content

Keycloak implementation in Docker environment with Demo Wordpress blog and ttyd.

Notifications You must be signed in to change notification settings

4nass/demo-keycloak-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keycloak on Docker Workshop

Keycloak implementation in Docker envirenment with Demo Wordpress blog and kali ttyd.

Project Focus:

Keycloak is an open source Identity and Access Management solution aimed at modern applications and services.

This project shows how to add Keycloak authentication to any web service with a builtin authentication layer (blog) or not (ttyd).

I run all my docker services behind traefik that receives requests on behalf of your system and finds out which components are responsible for handling them.

PostgreSQL database used to persist Keycloak data.

MySQL database is required by Wordpress to store and retrieve all of its data, including article content, user profiles, and other custom plugins.

Requirements:

  • Docker

  • Docker-compose

  • mkcert

  • IBM Security Verify Tenant

  • IBM Verify Mobile Application

Getting Started:

Adding the services hostnames in /etc/hosts:

127.0.0.1       traefik.docker.local
127.0.0.1       auth.docker.local
127.0.0.1       wordpress.docker.local
127.0.0.1       ttyd.docker.local

Docker network creation:

user@docker:~$ cd /path/to/repo.git
user@docker:~$ cat ./init/create_network.sh
docker network create transit_idp
docker network create transit_ttyd
docker network create transit_wp
user@docker:~$ ./init/create_network.sh

Generate local certificates for Traefik using mkcert :

user@docker:~$ cd /path/to/repo.git
# If it's the firt install of mkcert, run
user@docker:~$ mkcert -install
# Generate certificate for domain "docker.local", "domain.local" and their sub-domains
user@docker:~$ mkcert -cert-file certs/local-cert.pem -key-file certs/local-key.pem "docker.local" "*.docker.local" "domain.local" "*.domain.local"

Quickstart:

user@docker:~$ docker-compose up -d
user@docker:~$ docker-compose logs -f

User interface:

  • Reverse proxy: Traefik

    Alt text

  • Auth: Keycloak + Postgres

    Alt text Alt text

  • App1: Wordpress + MySQL a demo Wordpress blog (SAML)

    Alt text

  • App2: Kali-ttyd is a tool Kali terminal shared over the web (OIDC)

    Alt text

  • App3: whoami Go based image to return info about the host

    Alt text

Cleaning up:

Once you're finished playing around with this project, you can delete it and all the resources associated it by running:

user@docker:~$ docker-compose down --volumes

Help and Documentation:

Wordpress Plugin installed for SAML workflow:

https://plugins.miniorange.com/saml-single-sign-on-sso-wordpress-using-jboss-keycloak


About

Keycloak implementation in Docker environment with Demo Wordpress blog and ttyd.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published