From 63195664f43d43d16c51fdaf5bebcc3884546471 Mon Sep 17 00:00:00 2001 From: linoman <2051016+linoman@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:05:55 +0200 Subject: [PATCH] SSO LDAP: Fix ldap provider in providers list (#93472) * Correct comment about provider filter * Add type for LDAP provider * Ignore old LDAP init setup when using SSO --- .../app/features/auth-config/AuthProvidersListPage.tsx | 9 ++++++++- public/app/features/auth-config/index.ts | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/public/app/features/auth-config/AuthProvidersListPage.tsx b/public/app/features/auth-config/AuthProvidersListPage.tsx index d60b7b4751c..560c1a3a79a 100644 --- a/public/app/features/auth-config/AuthProvidersListPage.tsx +++ b/public/app/features/auth-config/AuthProvidersListPage.tsx @@ -52,9 +52,16 @@ export const AuthConfigPageUnconnected = ({ reportInteraction('authentication_ui_provider_clicked', { provider: providerType, enabled }); }; - // filter out saml and ldap from sso providers because it is already included in availableProviders + // filter out saml from sso providers because it is already included in availableProviders providers = providers.filter((p) => p.provider !== 'saml'); + providers = providers.map((p) => { + if (p.provider === 'ldap') { + p.settings.type = p.provider; + } + return p; + }); + const providerList = availableProviders.length ? [ ...availableProviders.map((p) => ({ diff --git a/public/app/features/auth-config/index.ts b/public/app/features/auth-config/index.ts index 015d65622e0..cca2b7208af 100644 --- a/public/app/features/auth-config/index.ts +++ b/public/app/features/auth-config/index.ts @@ -1,3 +1,4 @@ +import config from 'app/core/config'; import { contextSrv } from 'app/core/core'; import { getBackendSrv } from 'app/core/services/backend_srv'; import { AccessControlAction, Settings, SettingsSection } from 'app/types'; @@ -51,6 +52,11 @@ export async function getAuthProviderStatus(providerId: string): Promise