This project runs a complete authentication system using:
- Keycloak for OpenID Connect (OIDC) identity management
- MariaDB as Keycloak's persistent storage
- A JavaScript frontend client using
keycloak-jsfor login/logout - Podman Compose for container orchestration
project-root/
βββ podman-compose.yaml
βββ keycloak/
β βββ realm-export.json
βββ js-client/
β βββ Dockerfile
β βββ index.html
- Podman
- podman-compose
- Optional: Python 3.11+ virtual environment for stability
podman-compose down -v # Clean up any existing volumes
podman-compose up --build -d # Start all services| Service | URL | Description |
|---|---|---|
| Keycloak | http://localhost:8080 | Admin Console |
| JS Client | http://localhost:3000 | Static HTML + OIDC Login |
- Keycloak Admin:
admin/admin - Test User:
testuser/password(insiderealm-export.json)
Keycloak imports the realm once, only if the DB is empty.
If demo-realm doesn't appear:
podman-compose down -v # Reset MariaDB volume
podman-compose up -dFor development, you can force import every time (not for prod):
command: start-dev --import-realmLocated in js-client/index.html, this frontend:
- Connects to Keycloak via
keycloak-js - Allows login/logout
- Shows access token
Customize the index.html to suit your app.
- Edit
keycloak/realm-export.jsonto change realms, users, roles, clients. - Customize
js-client/index.htmlfor your frontend. - Add more services (backend APIs, etc.) to
podman-compose.yaml.
MIT (or your preferred license)
