This directory contains development tools and scripts for building, running, and managing the obp-keycloak-provider in local development environments.
The development/ directory contains exactly 2 shell scripts:
Purpose: Primary deployment script for local development with CI/CD-style approach
# Standard deployment (uses the unified Dockerfile at development/docker/Dockerfile)
./development/run-local-postgres-cicd.sh
# With custom themes (script will pass THEMED build-arg)
./development/run-local-postgres-cicd.sh --themed
# Alternatively: build directly with Docker using the single unified Dockerfile.
# Standard (no themes):
docker build --no-cache --build-arg THEMED=false -t obp-keycloak:standard -f development/docker/Dockerfile .
# Themed build (includes themes/obp and themes/obp-dark from repo context):
docker build --no-cache --build-arg THEMED=true -t obp-keycloak:themed -f development/docker/Dockerfile .What it does:
- ✅ Validates environment configuration
- ✅ Tests OBP API connectivity
- ✅ Builds Maven project
- ✅ Creates Docker image with cache invalidation
- ✅ Deploys container with proper configuration
- ✅ Performs health checks
- ✅ Themed mode: Validates and includes OBP custom themes
8-Step Pipeline:
- Environment validation
- OBP API connectivity test
- Maven build
- Container cleanup (stop)
- Container cleanup (remove)
- Docker image build
- Container start
- Health check
Purpose: Interactive container management with menu-driven interface
./development/manage-container.shFeatures:
- 🎛️ Interactive menu system
- 📊 Container status checking
- 📋 Log viewing (last 50 lines or follow mode)
- 🔄 Start/stop/restart operations
- 🗑️ Container removal
- 🌐 URL and credential display
- 🔍 Automatic container detection
# Copy and edit environment file
cp env.sample .env
# Edit .env with your configuration# Standard deployment (recommended: use the script which builds + deploys)
./development/run-local-postgres-cicd.sh
# Themed deployment (requires themes/obp/ directory; the script will validate and include themes)
./development/run-local-postgres-cicd.sh --themed
# Direct Docker build options using the single development Dockerfile:
# Build standard image (no themes):
docker build --no-cache --build-arg THEMED=false -t obp-keycloak:standard -f development/docker/Dockerfile .
# Build themed image (ensure themes/obp exists in repository root):
docker build --no-cache --build-arg THEMED=true -t obp-keycloak:themed -f development/docker/Dockerfile .The unified Dockerfile accepts several build-time arguments (passed with --build-arg). The provider JAR must be pre-built on the host before running docker build (the deployment script handles this automatically).
KEYCLOAK_VERSION(default:26.5.1) — the Keycloak base image tag used in the builder and final images. Example:
--build-arg KEYCLOAK_VERSION=26.5.1THEMED(default:false) — controls whether the Dockerfile retains thethemes/obpandthemes/obp-darkdirectories in the final image. Set totrueto keep themes in the image (the deployment script passes this when--themedis used):
--build-arg THEMED=trueBUILD_TIMESTAMPandJAR_CHECKSUM— used to invalidate build cache and force rebuild when sources or built artifacts change. The deployment script computes and passes these automatically. If building manually, compute and pass them to ensure cache invalidation:
BUILD_TIMESTAMP=$(date +%s)
JAR_CHECKSUM=$(sha256sum target/obp-keycloak-provider.jar | cut -d' ' -f1)
docker build --no-cache \
--build-arg BUILD_TIMESTAMP="$BUILD_TIMESTAMP" \
--build-arg JAR_CHECKSUM="$JAR_CHECKSUM" \
--build-arg THEMED=true \
-f development/docker/Dockerfile -t obp-keycloak:themed .Note: In CI you should pin
KEYCLOAK_VERSIONto a specific version for reproducible builds. Avoidlatestin CI.
# Interactive management
./development/manage-container.shKC_DB_URL- Keycloak internal database JDBC URLKC_DB_USERNAME- Keycloak database userKC_DB_PASSWORD- Keycloak database passwordOBP_API_URL- Base URL of the OBP API instance (e.g.http://localhost:8080)OBP_API_USERNAME- OBP admin user (needsCanGetAnyUser,CanVerifyUserCredentials)OBP_API_PASSWORD- OBP admin passwordOBP_API_CONSUMER_KEY- Consumer key registered in OBP for Direct LoginOBP_AUTHUSER_PROVIDER- Provider filter — mandatory for security
KEYCLOAK_ADMIN- Admin username (default: admin)KEYCLOAK_ADMIN_PASSWORD- Admin password (default: admin)KEYCLOAK_HTTP_PORT- HTTP port (default: 7787)KEYCLOAK_HTTPS_PORT- HTTPS port (default: 8443)KEYCLOAK_MGMT_PORT- Management/health port (default: 9000)FORGOT_PASSWORD_URL- Custom forgot-password link (default: Keycloak built-in flow)
./development/manage-container.shMenu Options:
- Check container status
- View logs (last 50 lines)
- Follow logs (real-time)
- Stop container
- Start container
- Restart container
- Remove container
- Stop and remove
- Show access URLs
- Exit
# View logs
docker logs obp-keycloak-local -f
# Stop all containers
docker stop obp-keycloak-local
# Remove with volumes (careful: deletes data)
docker rm obp-keycloak-local
# Check status
docker ps --filter name=obp-keycloak-localthemes/obp/theme.properties- Theme configurationthemes/obp/login/login.ftl- Login templatethemes/obp/login/template.ftl- Base template- Optional: CSS, images, message files in
themes/obp/login/resources/
./development/run-local-postgres-cicd.sh --themed- Access Admin Console: https://localhost:8443/admin
- Login with admin credentials
- Go to: Realm Settings > Themes
- Select "obp" from Login theme dropdown
- Save configuration
Inside Docker, 127.0.0.1 resolves to the container itself. The deployment script
rewrites localhost/127.0.0.1 to host.docker.internal automatically. If OBP runs
on a remote host, set OBP_API_URL to its actual hostname or IP.
# Check port conflicts
netstat -tulpn | grep -E ':(7787|8443|9000)'
# Review container logs
docker logs obp-keycloak-local
# Full cleanup if needed
docker system prune -f# Check theme files exist
find themes/obp -type f
# Verify theme configuration
cat themes/obp/theme.properties
# Try standard deployment first
./development/run-local-postgres-cicd.sh- OBP_AUTHUSER_PROVIDER is mandatory: Set provider name in
.envfile
After successful deployment:
- HTTP: http://localhost:7787
- HTTPS: https://localhost:8443
- Admin Console: https://localhost:8443/admin
- Username: admin
- Password: admin
- Use secure passwords: Never use defaults in production
- Validate configuration: The deployment script validates all settings
- Monitor logs: Use
./development/manage-container.shfor log monitoring - Clean deployments: Scripts ensure clean state on each run
- Theme testing: Test standard deployment before themed if issues occur
For issues with development scripts:
- Check container logs:
docker logs obp-keycloak-local - Use the management script:
./development/manage-container.sh - Ensure
.envfile contains all required variables - Review troubleshooting section above
- Check Docker system resources:
docker system df
The scripts are designed to fail fast and provide clear error messages to facilitate quick problem resolution in local development environments.