Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

ui sso settings

Ishaan Jaff0f44b33e0fab
diff --git a/ui/litellm-dashboard/src/components/SSOSettings.tsx b/ui/litellm-dashboard/src/components/SSOSettings.tsx
new file mode 100644
index 00000000000..8e6b31d3164
--- /dev/null
+++ b/ui/litellm-dashboard/src/components/SSOSettings.tsx
@@ -0,0 +1,107 @@
+import React, { useState, useEffect } from "react";
+import { Card, Title, Text, Divider } from "@tremor/react";
+import { Typography, Spin, message } from "antd";
+import { getSSOSettingsCall } from "./networking";
+
+interface SSOSettingsProps {
+ accessToken: string | null;
+}
+
+const SSOSettings: React.FC<SSOSettingsProps> = ({ accessToken }) => {
+ const [loading, setLoading] = useState<boolean>(true);
+ const [settings, setSettings] = useState<any>(null);
+ const { Paragraph } = Typography;
+
+ useEffect(() => {
+ const fetchSSOSettings = async () => {
+ if (!accessToken) {
+ setLoading(false);
+ return;
+ }
+
+ try {
+ const data = await getSSOSettingsCall(accessToken);
+ setSettings(data);
+ } catch (error) {
+ console.error("Error fetching SSO settings:", error);
+ message.error("Failed to fetch SSO settings");
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ fetchSSOSettings();
+ }, [accessToken]);
+
+ const renderValue = (value: any): JSX.Element => {
+ if (value === null) return <span className="text-gray-400">Not set</span>;
+
+ if (typeof value === "object") {
+ return (
+ <pre className="bg-gray-50 p-2 rounded overflow-auto max-h-60">
+ {JSON.stringify(value, null, 2)}
+ </pre>
+ );
+ }
+
+ return <span>{String(value)}</span>;
+ };
+
+ if (loading) {
+ return (
+ <div className="flex justify-center items-center h-64">
+ <Spin size="large" />
+ </div>
+ );
+ }
+
+ if (!settings) {
+ return (
+ <Card>
+ <Title>SSO Settings</Title>
+ <Text>No settings available or you don't have permission to view them.</Text>
+ </Card>
+ );
+ }
+
+ // Dynamically render settings based on the schema
+ const renderSettings = () => {
+ const { values, schema } = settings;
+
+ if (!schema || !schema.properties) {
+ return <Text>No schema information available</Text>;
+ }
+
+ return Object.entries(schema.properties).map(([key, property]: [string, any]) => {
+ const value = values[key];
+
+ return (
+ <div key={key} className="mb-6">
+ <Text className="font-medium text-lg">{key.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}</Text>
+ <Paragraph className="text-sm text-gray-500 mt-1">
+ {property.description || "No description available"}
+ </Paragraph>
+ <div className="mt-2 p-3 bg-gray-50 rounded-md">
+ {renderValue(value)}
+ </div>
+ </div>
+ );
+ });
+ };
+
+ return (
+ <Card>
+ <Title>SSO Settings</Title>
+ {settings.schema?.description && (
+ <Paragraph>{settings.schema.description}</Paragraph>
+ )}
+ <Divider />
+
+ <div className="mt-4">
+ {renderSettings()}
+ </div>
+ </Card>
+ );
+};
+
+export default SSOSettings;
\ No newline at end of file
diff --git a/ui/litellm-dashboard/src/components/admins.tsx b/ui/litellm-dashboard/src/components/admins.tsx
index cd0f34b7060..059933f6849 100644
--- a/ui/litellm-dashboard/src/components/admins.tsx
+++ b/ui/litellm-dashboard/src/components/admins.tsx
@@ -38,6 +38,7 @@ import OnboardingModal from "./onboarding_link";
import { InvitationLink } from "./onboarding_link";
import SSOModals from "./SSOModals";
import { ssoProviderConfigs } from './SSOModals';
+import SSOSettings from "./SSOSettings";
interface AdminPanelProps {
searchParams: any;
@@ -621,6 +622,12 @@ const AdminPanel: React.FC<AdminPanelProps> = ({
<b>{nonSssoUrl}</b>{" "}
</a>
</Callout>
+ {/* Add SSO Settings Component */}
+ {premiumUser && accessToken && (
+ <div className="mt-8">
+ <SSOSettings accessToken={accessToken} />
+ </div>
+ )}
</Grid>
</div>
);