Skip to content

Conversation

@jbendson
Copy link
Collaborator

No description provided.

Josh Bendson added 2 commits January 26, 2026 23:39
Implements configurable mapping of external SSO provider groups (Entra, Keycloak)
to internal CIDX groups (admins, powerusers, users) during JIT user provisioning.

Key Features:
- Parse groups from ID token instead of userinfo endpoint
- Support list-based group mapping format with optional display names
- First-match strategy with graceful fallback to "users" group
- Backward compatibility with old dict format (auto-migrated)
- Fixed group_manager injection bug during OIDC config reload
- Removed insecure ID token logging

Configuration Format:
[
  {
    "external_group_id": "guid-or-name",      // Required: matches token
    "external_group_name": "Display Name",    // Optional: for docs/UI
    "cidx_group": "admins"                    // Required: target group
  }
]

Behavior:
- Mapping matches + group exists → assign to mapped group
- Mapping matches + group missing → fallback to "users" (with warning)
- No mappings or no match → fallback to "users"
- Existing users not reassigned on re-login (AC3)

Changes:
- config_manager.py: Add group_mappings config with backward compatibility
- sso_provisioning_hook.py: Implement matching logic and fallback behavior
- oidc_provider.py: Parse ID token for groups, remove insecure logging
- oidc_manager.py: Pass groups from token to provisioning hook
- config_service.py: Handle both dict and list mapping formats
- routes.py: Fix group_manager injection during config reload
- config_section.html: Display mappings with optional names in UI
- Tests: Update for ID token parsing and new mapping format

Security: Removed raw ID token payload logging (only logs claim names)
- Add create_mock_id_token() helper function to generate test JWT tokens
- Update all get_user_info() calls to pass both access_token and id_token
- Remove httpx mocking since ID token parsing doesn't make HTTP calls
- Fix test_sso_callback_rejects_invalid_state by properly initializing oidc_manager

All 59 OIDC tests now passing.
@jbendson jbendson force-pushed the feature/sso-group-mapping branch from 3f0cfc8 to a84b087 Compare January 27, 2026 05:41
- Update version in all documentation files
- Add CHANGELOG entry for SSO group mapping feature
- Update version references in architecture and query guide
@jbendson jbendson force-pushed the feature/sso-group-mapping branch from a84b087 to 257010d Compare January 27, 2026 05:45
@jsbattig jsbattig merged commit 591221a into master Jan 27, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants