snorlax-auth is our centralized authentication and authorization infrastructure using Keycloak. Just as Snorlax blocks the path of unauthorized trainers, this repository manages and secures your application's authentication needs.
- 🛡️ Rock-solid authentication barrier
- 🔑 Centralized user management
- 🔒 Role-based access control (RBAC)
- 🔄 OAuth 2.0 and OpenID Connect support
- Docker (20.10.x or higher)
- Docker Compose (2.x or higher)
- Make (required for automation scripts)
-
Clone the repository:
git clone git@github.com:your-organization/snorlax-auth.git cd snorlax-auth
-
Set up environment variables:
cp .env.example .env
-
Generate Certificates: Before starting development, you need to generate self-signed certificates for local use. Run the following command:
make generate-certs
This will create a
certs
directory containingcert.pem
andkey.pem
files. -
Start the services:
make up
-
Access Keycloak:
- Admin Console: https://localhost:8443/admin
- Default credentials (change these immediately):
- Username: admin
- Password: (from your .env file)
Our Makefile provides comprehensive commands for managing the Keycloak infrastructure. View all available commands with:
make help
make up # Wake up all services
make down # Put services to rest
make restart # Quick Rest & wake up
make status # Check Snorlax's status
make logs # View Snorlax's dreams (logs)
make backup # Create a backup of the realm and database
make restore # Restore from a backup (Usage: make restore BACKUP_FILE=path/to/backup.json)
make generate-certs # Generate self-signed certificates
- Never commit sensitive data (don't disturb a sleeping Snorlax)
- Use
make check-env
before deployment - Regular
make security-scan
runs - Maintain regular backups using
make backup
- Test restores periodically
- Run
make help
for command assistance - Create an issue in this repository
- In Chrome, put in
chrome://flags/#allow-insecure-localhost
in the address bar. - Enable the option that says "Allow invalid certificates for resources loaded from localhost".
- Restart Chrome, and it should allow the site.
Rest easy knowing Snorlax is guarding your authentication 🛡️😴