Skip to content

Allow disabling OIDC group synchronization independently of user auto-provisioning and role assignment #4058

Open

Description

@pinokew

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 groups claim.
  • 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 — Calls SyncGroupMemberships() 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:

  1. JIT provisioning continues working.
  2. Global role assignment from OIDC Security Groups continues working.
  3. Existing local group memberships survive repeated logins.
  4. No OIDC groups are created or synchronized when disabled.
  5. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions