Enterprise-grade authentication with single sign-on and advanced user management
Keycloak integration provides enterprise-level authentication for FlagFlow, supporting single sign-on (SSO), advanced user management, and integration with existing identity infrastructure. This is the recommended solution for larger organizations with complex authentication requirements.
Enterprise Features: OAuth 2.0/OpenID Connect, SSO, fine-grained permissions, user federation, multi-factor authentication, and comprehensive audit logging.
Install Keycloak using Docker or your preferred method:
# Using Docker Compose
version: '3.8'
services:
keycloak:
image: quay.io/keycloak/keycloak:latest
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin-password
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: keycloak-db-password
ports:
- "8080:8080"
command: start-dev
depends_on:
- postgres
postgres:
image: postgres:15
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak-db-password
volumes:
- keycloak_db:/var/lib/postgresql/data
volumes:
keycloak_db:http://localhost:8080flagflowNavigate to Realm Settings and configure:
flagflow-frontendOpenID ConnectIn the client settings tab:
Keycloak Callback URL: FlagFlow uses the callback URL /auth/keycloak/callback for OAuth authentication redirects.
# Valid redirect URIs (include the callback path) https://your-flagflow-domain.com/auth/keycloak/callback https://your-flagflow-domain.com/* http://localhost:3000/auth/keycloak/callback # For development http://localhost:3000/* # For development # Web origins https://your-flagflow-domain.com http://localhost:3000 # For development # Access Type: confidential # Service Accounts: Enabled (if using service accounts)
Navigate to your client and create the following roles under the "Roles" tab:
| Role Name | Description |
|---|---|
| flag-create | Can create, rename/move, and delete flags |
| flag-schema | Can manage flag schemas |
| flag-value | Can manage flag values |
| users | Can add, modify, or remove users and manage sessions |
| migration | Can restore backups or execute migrations |
Create composite roles for common user types:
flag-value roleflag-create, flag-schema, flag-value rolesusers and migrationConfigure FlagFlow to use Keycloak authentication:
# Disable built-in user management SESSION_USERS_ENABLED=false # Keycloak configuration KEYCLOAK_HOST=https://your-keycloak-domain.com KEYCLOAK_REALM=flagflow KEYCLOAK_CLIENT=flagflow-frontend # Other standard configuration LOGLEVEL=info ENVIRONMENT=production ETCD_SERVER=your-etcd-server:2379
SESSION_USERS_ENABLED=false to disable built-in authenticationFor larger organizations, use groups to manage permissions more efficiently:
To integrate with existing directory services:
To migrate from FlagFlow's built-in authentication to Keycloak:
SESSION_USERS_ENABLED=false to disable built-in authenticationMigration Tip: Consider running both authentication methods temporarily during migration to ensure smooth transition for all users.