Database configuration
Environment Variables
- Database user needs full access to
authorization_systemdatabase - PostgreSQL must be available before service startup
CAS client library configuration
The authorization-system uses the CAS client library to communicate with SpiceDB for ACL operations.
Environment Variables
- SpiceDB Host: Service hostname (typically
spicedb) - SpiceDB Port: gRPC port (standard:
50051) - SpiceDB Token: Authentication token for SpiceDB access
OAuth2/Keycloak configuration
Environment Variables
OAuth2 Client
Must be configured in Keycloak with appropriate scopes for platform access
Service Account
Requires admin privileges in Keycloak for user management operations
Redis configuration
Environment Variables
Management
Environment Variables
Organization admin bootstrap
Primary method (recommended)
SetSPRING_LIQUIBASE_PARAMETERS_DEFAULTORGADMINUSERNAME (default: admin@flowx.ai)
Process:
- System searches for this username in Keycloak
- Copies the userβs
sub_id(subject ID) to authorization-system database - Grants organization admin privileges automatically
Fallback method
SetSPRING_LIQUIBASE_PARAMETERS_DEFAULTORGADMINUSERSUBJECTID with a specific Keycloak subject ID
Process:
- Creates user directly in authorization-system database
- Assigns organization admin roles
- Used when username method fails or is set to null
Error handling
If incorrect subject_id is provided:- Login will fail
- No org-admin privileges granted
- Manual database correction required
If youβve deployed with an incorrect subject_id, use this SQL script to fix it:The first organization administrator always has the ID
00000000-0000-0000-0000-100000000001 in the authorization-system database.Customer-specific variables
Required Customization: These variables must be updated for each deployment environment.
SECURITY_OAUTH2_BASE_SERVER_URL- Your Keycloak server URLSECURITY_OAUTH2_REALM- Your Keycloak realm nameSECURITY_OAUTH2_CLIENT_CLIENT_ID- Your OAuth2 client identifierSPRING_DATASOURCE_URL- Your PostgreSQL connection details- Service hostnames - Update to match your Kubernetes service names
Secrets management
Required Kubernetes Secrets:SPRING_DATASOURCE_PASSWORDFLOWX_SPICEDB_TOKENSPRING_REDIS_PASSWORDSECURITY_OAUTH2_CLIENT_CLIENT_SECRETSECURITY_OAUTH2_SERVICE_ACCOUNT_ADMIN_CLIENT_SECRET
Deployment prerequisites
Infrastructure
- PostgreSQL with
authorization_systemdatabase - SpiceDB with authentication configured
- Redis for caching
Identity & Access
- Keycloak with configured realm
- OAuth2 clients created
- Admin user exists in Keycloak
Architecture notes
Database Access Control: Only authorization-system has direct write access to the CAS PostgreSQL database. Other services communicate via REST APIs only.
SpiceDB Integration: Uses PostgreSQL as backend storage and communicates via gRPC through the CAS client library.
Ingress configuration
The Authorization System uses the standard FlowX.AI ingress pattern. For complete setup instructions including the full ingress template, CORS configuration, and troubleshooting, see the Ingress Configuration Guide. Service-specific values for Authorization System:- Ingress name:
authorization-system-admin - Service path:
/auth/api(/|$)(.*)(/|$)(.*) - Service name:
authorization-system - Rewrite target:
/api/$2 - Fx-Workspace-Id: Required
Complete Ingress Configuration
View the centralized ingress guide for the complete configuration template, annotations reference, and best practices.

