Skip to content

vkanta/common

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐳 Keycloak + MariaDB + JS Client (Podman Setup)

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-js for login/logout
  • Podman Compose for container orchestration

πŸ“ Project Structure

project-root/
β”œβ”€β”€ podman-compose.yaml
β”œβ”€β”€ keycloak/
β”‚   └── realm-export.json
β”œβ”€β”€ js-client/
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── index.html

Project Structure


πŸš€ Getting Started

πŸ”§ Prerequisites

▢️ Start the Stack

podman-compose down -v               # Clean up any existing volumes
podman-compose up --build -d         # Start all services

🌐 Services

Service URL Description
Keycloak http://localhost:8080 Admin Console
JS Client http://localhost:3000 Static HTML + OIDC Login

πŸ” Default Credentials

  • Keycloak Admin: admin / admin
  • Test User: testuser / password (inside realm-export.json)

🧠 How Realm Import Works

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

For development, you can force import every time (not for prod):

command: start-dev --import-realm

πŸ’» JS Client Features

Located 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.


πŸ› οΈ Customization

  • Edit keycloak/realm-export.json to change realms, users, roles, clients.
  • Customize js-client/index.html for your frontend.
  • Add more services (backend APIs, etc.) to podman-compose.yaml.

πŸ“„ License

MIT (or your preferred license)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors