mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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
This commit is contained in:
parent
362ffff591
commit
63195664f4
@ -52,9 +52,16 @@ export const AuthConfigPageUnconnected = ({
|
|||||||
reportInteraction('authentication_ui_provider_clicked', { provider: providerType, enabled });
|
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.filter((p) => p.provider !== 'saml');
|
||||||
|
|
||||||
|
providers = providers.map((p) => {
|
||||||
|
if (p.provider === 'ldap') {
|
||||||
|
p.settings.type = p.provider;
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
});
|
||||||
|
|
||||||
const providerList = availableProviders.length
|
const providerList = availableProviders.length
|
||||||
? [
|
? [
|
||||||
...availableProviders.map((p) => ({
|
...availableProviders.map((p) => ({
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import config from 'app/core/config';
|
||||||
import { contextSrv } from 'app/core/core';
|
import { contextSrv } from 'app/core/core';
|
||||||
import { getBackendSrv } from 'app/core/services/backend_srv';
|
import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||||
import { AccessControlAction, Settings, SettingsSection } from 'app/types';
|
import { AccessControlAction, Settings, SettingsSection } from 'app/types';
|
||||||
@ -51,6 +52,11 @@ export async function getAuthProviderStatus(providerId: string): Promise<AuthPro
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function initAuthConfig() {
|
export function initAuthConfig() {
|
||||||
|
// skip the LDAP provider if it is enabled by SSO settings
|
||||||
|
if (config.featureToggles.ssoSettingsApi && config.featureToggles.ssoSettingsLDAP) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const ldapAuthProvider: AuthProviderInfo = {
|
const ldapAuthProvider: AuthProviderInfo = {
|
||||||
id: 'ldap',
|
id: 'ldap',
|
||||||
type: 'LDAP',
|
type: 'LDAP',
|
||||||
|
Loading…
Reference in New Issue
Block a user