Problem
When using Keycloak with the helm chart, autoprovisioning is not properly configured. The chart currently runs both Keycloak and the built-in IDM service simultaneously, which is not supported and causes undefined behavior. Users created in Keycloak may or may not be properly provisioned in OpenCloud.
Current State
The helm chart:
- Runs both external Keycloak and built-in IDM/IDP services
- Does not set required autoprovisioning environment variables
- Creates a hybrid mode that can lead to errors like:
LDAP Result Code 200 "Network Error": dial tcp [::1]:9235: connect: connection refused
failed to add user
Autoprovisioning user failed
Expected Behavior
When Keycloak is enabled, the helm chart should:
- Automatically disable built-in IDM/IDP services
- Enable and configure autoprovisioning
- Set proper user claim mappings
- Configure LDAP for write access
Reference: opencloud-compose Pattern
The opencloud-compose repository correctly configures autoprovisioning in idm/external-idp.yml:
# Disable built-in identity services
OC_EXCLUDE_RUN_SERVICES: idp,idm
# Enable autoprovisioning
PROXY_AUTOPROVISION_ACCOUNTS: "true"
OC_LDAP_SERVER_WRITE_ENABLED: "true"
# Configure user claims
PROXY_USER_OIDC_CLAIM: "sub"
PROXY_AUTOPROVISION_CLAIM_USERNAME: "sub"
PROXY_USER_CS3_CLAIM: "username"
# Additional configuration
OC_ADMIN_USER_ID: ""
GRAPH_LDAP_SERVER_UUID: "false"
OC_LDAP_USER_SCHEMA_ID: "opencloudUUID"
FRONTEND_READONLY_USER_ATTRIBUTES: "user.onPremisesSamAccountName,user.displayName,user.mail,user.passwordProfile,user.memberOf"
Proposed Solution
Add a new configuration section to properly handle Keycloak autoprovisioning:
keycloak:
autoprovisioning:
# Enable autoprovisioning mode (disables built-in IDM/IDP)
enabled: true
# User identification claim
userClaim: "sub"
# Username claim for provisioning
usernameClaim: "sub"
# Make user attributes read-only in UI
readonlyAttributes: true
When keycloak.autoprovisioning.enabled is true, automatically:
- Add
idp,idm to excludeServices
- Set all required autoprovisioning environment variables
- Clear
OC_ADMIN_USER_ID to prevent conflicts
- Configure LDAP write access
Benefits
- Proper separation between Keycloak and built-in identity services
- Predictable autoprovisioning behavior
- Prevents common deployment errors
- Follows established patterns from opencloud-compose
- Simplifies configuration for users
Related Issues
Testing
The configuration can be tested by:
- Creating a new user in Keycloak
- Logging in with that user
- Verifying the user is automatically created in OpenCloud
- Checking that built-in IDM/IDP services are not running
Problem
When using Keycloak with the helm chart, autoprovisioning is not properly configured. The chart currently runs both Keycloak and the built-in IDM service simultaneously, which is not supported and causes undefined behavior. Users created in Keycloak may or may not be properly provisioned in OpenCloud.
Current State
The helm chart:
Expected Behavior
When Keycloak is enabled, the helm chart should:
Reference: opencloud-compose Pattern
The opencloud-compose repository correctly configures autoprovisioning in
idm/external-idp.yml:Proposed Solution
Add a new configuration section to properly handle Keycloak autoprovisioning:
When
keycloak.autoprovisioning.enabledis true, automatically:idp,idmtoexcludeServicesOC_ADMIN_USER_IDto prevent conflictsBenefits
Related Issues
OC_ADMIN_USER_ID)OC_EXCLUDE_RUN_SERVICESbut not full autoprovisioning)Testing
The configuration can be tested by: