Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Group Management

This example demonstrates comprehensive group management capabilities in SCIM, including group creation, member management, and the complex relationships between users and groups. It showcases how SCIM handles group membership references and maintains referential integrity.

What This Example Demonstrates

  • Group Lifecycle Management - Creating, updating, and deleting groups with proper SCIM semantics
  • Member Relationship Handling - Adding and removing users from groups with automatic reference management
  • $ref Field Generation - How SCIM automatically creates proper resource references
  • Referential Integrity - Maintaining consistency between users and their group memberships
  • Complex Group Scenarios - Nested groups, bulk operations, and membership queries

Key Features Showcased

Automatic Reference Management

See how the ScimServer automatically generates proper SCIM $ref fields when creating group memberships, ensuring full protocol compliance without manual URL construction.

Group Schema Validation

Watch the StandardResourceProvider validate group data against the SCIM 2.0 Group schema, ensuring displayName requirements and proper member structure.

Member Relationship Patterns

Explore different approaches to group membership - from simple user references to complex nested group structures with proper SCIM semantics.

Bulk Membership Operations

The example demonstrates efficient patterns for managing large numbers of group memberships while maintaining referential integrity and performance.

Concepts Explored

This example builds on several key architectural concepts:

Perfect For Understanding

This example is ideal if you're:

  • Implementing Access Control - Groups as authorization units
  • Building Team Management - Organizing users into teams or departments
  • Working with Complex Hierarchies - Nested organizational structures
  • Ensuring SCIM Compliance - Proper group and membership handling

Group Operation Patterns

The example covers essential group management scenarios:

Basic Group Operations

  • Creating groups with displayName and optional metadata
  • Updating group properties and descriptions
  • Deleting groups and handling member cleanup

Membership Management

  • Adding individual users to groups
  • Removing members while maintaining references
  • Bulk membership operations for efficiency
  • Querying group membership and user affiliations

Advanced Scenarios

  • Nested group hierarchies and inheritance patterns
  • Group-to-group relationships and complex structures
  • Membership validation and constraint enforcement
  • Cross-reference consistency checking

SCIM Protocol Details

Watch how the library handles SCIM-specific group requirements:

  • displayName Attribute - Required field validation and uniqueness
  • members Array - Proper structure with value, type, and $ref fields
  • Meta Information - Automatic timestamp and version management
  • Resource Location - Proper endpoint URL generation

Running the Example

cargo run --example group_example

The output demonstrates group creation, membership addition, reference generation, and complex query patterns - all with detailed explanations of the SCIM protocol behavior.

Real-World Applications

This example shows patterns useful for:

  • Enterprise Directory Services - Organizational unit management
  • Application Security - Role-based access control
  • Team Collaboration - Project and department groupings
  • Identity Federation - Cross-system group synchronization

Next Steps

After exploring group management:

Source Code

View the complete implementation: examples/group_example.rs