Repository navigation
Description
Is your feature request related to a problem? Please describe.
OpenCloud automatically synchronizes group memberships from the OIDC groups claim when JIT provisioning is enabled.
Problem: On every synchronization, OpenCloud removes users from manually created local groups that are not present in the OIDC token.
Our setup:
- IdP: Microsoft Entra ID (Microsoft 365 A1).
- Authentication: OIDC with JIT provisioning.
- Global roles:
staff/admin, mapped from Entra ID Security Group GUIDs. - Local groups: Manually managed in OpenCloud for resource permissions.
Authentication and role assignment work correctly, but users lose their manually assigned local group memberships after logging in.
Current configuration:
PROXY_AUTOPROVISION_ACCOUNTS: "true"
PROXY_AUTOPROVISION_CLAIM_GROUPS: "groups"
PROXY_ROLE_ASSIGNMENT_DRIVER: "oidc"
PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM: "groups"Removing PROXY_AUTOPROVISION_CLAIM_GROUPS does not help because it defaults to groups. Setting it to an empty string may cause all local group memberships to be removed.
Describe the solution you'd like
Add an independent option to disable OIDC group synchronization while keeping JIT provisioning and global role assignment enabled.
For example:
PROXY_AUTOPROVISION_ACCOUNTS: "true"
PROXY_AUTOPROVISION_GROUPS_ENABLED: "false" # Proposed new option
PROXY_ROLE_ASSIGNMENT_DRIVER: "oidc"
PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM: "groups"Expected behavior when disabled:
- Users are automatically created on first login (JIT).
- Global roles continue to be assigned from the OIDC
groupsclaim. - No groups are automatically created or synchronized from OIDC.
- Manually managed local group memberships remain unchanged after login.
Suggested implementation:
In services/proxy/pkg/middleware/account_resolver.go, make the existing SyncGroupMemberships() call conditional:
if m.autoProvisionAccounts {
// Existing user provisioning logic
if m.autoProvisionGroups {
m.userProvider.SyncGroupMemberships(...)
}
}
// Existing OIDC role assignment remains unchanged
m.userRoleAssigner.UpdateUserRoleAssignment(...)The new option should default to true for backward compatibility.
Describe alternatives you've considered
- Disable JIT: Preserves local groups but requires manual user provisioning.
- Use Entra App Roles: Group assignment to Enterprise Applications is unavailable in our Microsoft 365 A1 environment.
- Use a different or empty groups claim: May result in removal of existing group memberships.
- Custom synchronization scripts or OpenCloud fork: Unnecessary complexity and maintenance overhead.
Additional context
Relevant source code:
services/proxy/pkg/middleware/account_resolver.go— CallsSyncGroupMemberships()during automatic provisioning, independently of OIDC role assignment.services/proxy/pkg/user/backend/cs3.go— Removes group memberships absent from the OIDC claim.
Acceptance criteria:
- JIT provisioning continues working.
- Global role assignment from OIDC Security Groups continues working.
- Existing local group memberships survive repeated logins.
- No OIDC groups are created or synchronized when disabled.
- Default behavior remains unchanged for existing installations.
This would allow organizations to use an external IdP for authentication and global roles while managing resource-level groups locally in OpenCloud.
Activity