Skip to content

[Feature] UI - SSO: Add Team Mappings#20299

Merged
yuneng-jiang merged 3 commits intomainfrom
litellm_ui_allowed_routes_dropdown
Feb 3, 2026
Merged

[Feature] UI - SSO: Add Team Mappings#20299
yuneng-jiang merged 3 commits intomainfrom
litellm_ui_allowed_routes_dropdown

Conversation

@yuneng-jiang
Copy link
Collaborator

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🆕 New Feature
✅ Test

Changes

Adds team mappings UI to SSO settings. Users can configure team mappings for Okta and Generic SSO providers by enabling a checkbox and specifying the JWT field name that contains team IDs. The team mappings configuration is displayed in the SSO settings view and properly handled during edit and delete operations.

Screenshots

image image

@vercel
Copy link

vercel bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Feb 2, 2026 10:19pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 2, 2026

Greptile Overview

Greptile Summary

Added team mappings UI feature for SSO configuration, allowing users to specify a JWT field name that contains team IDs for Okta and Generic SSO providers.

  • Adds a checkbox "Use Team Mappings" and "Team IDs JWT Field" input to the SSO settings form for Okta and Generic providers
  • Displays the configured JWT field as a Tag in the SSO settings view when enabled
  • Properly handles team mappings during edit and delete operations
  • Includes comprehensive test coverage with 15 new test cases across form rendering, data processing, and payload generation
  • UI changes are built on top of existing backend support for team_mappings in the SSOConfig model

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Clean implementation with comprehensive test coverage (15 new tests), consistent patterns with existing role mappings feature, proper null handling in delete flow, and validation rules for required fields
  • No files require special attention

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/Modals/BaseSSOSettingsForm.tsx Added team mappings checkbox and JWT field input for Okta and Generic providers with proper validation
ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/Modals/EditSSOSettingsModal.tsx Extracts and populates team mappings from SSO settings data when editing
ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/SSOSettings.tsx Displays team IDs JWT field as a Tag when team mappings are enabled for Okta/Generic providers
ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/utils.ts Processes team mappings payload for Okta and Generic providers when enabled

Sequence Diagram

sequenceDiagram
    participant User
    participant UI as SSO Settings UI
    participant Form as BaseSSOSettingsForm
    participant Utils as processSSOSettingsPayload
    participant API as Backend API
    participant DB as Database

    User->>UI: Opens SSO Settings
    UI->>API: GET /sso/settings
    API->>DB: Fetch SSO configuration
    DB-->>API: Return SSOConfig (with team_mappings)
    API-->>UI: Return SSO settings
    UI->>UI: detectSSOProvider()
    UI->>UI: Check if team_mappings exists
    UI->>User: Display settings with Team IDs JWT Field Tag

    User->>UI: Click "Edit SSO Settings"
    UI->>Form: Open EditSSOSettingsModal
    Form->>Form: Extract team_mappings from data
    Form->>Form: Set use_team_mappings = true
    Form->>Form: Set team_ids_jwt_field value
    Form->>User: Display form with team mappings checkbox checked

    User->>Form: Select Okta/Generic provider
    Form->>User: Show "Use Team Mappings" checkbox
    User->>Form: Check "Use Team Mappings"
    Form->>User: Show "Team IDs JWT Field" input (required)
    User->>Form: Enter JWT field name (e.g., "teams")

    User->>Form: Click Save
    Form->>Utils: processSSOSettingsPayload(formValues)
    Utils->>Utils: Check provider supports team mappings
    Utils->>Utils: Create team_mappings object
    Utils->>Utils: Remove UI-only fields
    Utils-->>Form: Return processed payload
    Form->>API: PUT /sso/settings with team_mappings
    API->>DB: Update SSO config with team_mappings
    DB-->>API: Confirm update
    API-->>Form: Success response
    Form->>UI: Trigger refetch
    UI->>User: Display updated settings

    Note over User,DB: Delete Flow
    User->>UI: Click "Delete SSO Settings"
    UI->>API: PUT /sso/settings with all fields = null
    Note right of API: Includes team_mappings: null
    API->>DB: Clear SSO configuration
    DB-->>API: Confirm deletion
    API-->>UI: Success response
    UI->>User: Show empty state
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@yuneng-jiang yuneng-jiang merged commit 8eba641 into main Feb 3, 2026
48 of 65 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.

1 participant