This project sets up KeyCloak as an OAuth broker for Google authentication. It includes scripts to configure KeyCloak and a dummy application to test the OAuth flow.
- Docker and Docker Compose
- Python 3.8+
- Google OAuth credentials (Client ID and Client Secret)
- Clone this repository
- Copy
.env.exampleto.envand fill in your Google OAuth credentials - Start KeyCloak:
docker-compose up -d
- Install Python dependencies:
pip install -r requirements.txt
- Set up the KeyCloak realm and Google identity provider:
python scripts/setup_realm.py
- Register a test client in KeyCloak:
python scripts/keycloak_admin.py register-client --name test-client
- Start the dummy application:
python dummy_app/main.py
- Open your browser and navigate to
http://localhost:8090 - Click the "Login with Google" button to test the OAuth flow
docker-compose.yml: Docker configuration for KeyCloak.env: Environment variables for configurationscripts/: Scripts for KeyCloak administrationdummy_app/: FastAPI application for testing the OAuth flow