diff --git a/opencti-platform/opencti-graphql/src/config/providers.js b/opencti-platform/opencti-graphql/src/config/providers.js index 93190c41846a..b24c96c9b348 100644 --- a/opencti-platform/opencti-graphql/src/config/providers.js +++ b/opencti-platform/opencti-graphql/src/config/providers.js @@ -267,12 +267,8 @@ for (let i = 0; i < providerKeys.length; i += 1) { const orgaDefault = mappedConfig.organizations_default ?? []; const orgasMapping = mappedConfig.organizations_management?.organizations_mapping || []; const orgaPath = mappedConfig.organizations_management?.organizations_path || ['organizations']; - const availableOrgas = R.flatten( - orgaPath.map((path) => { - const value = R.path(path.split('.'), profile) || []; - return Array.isArray(value) ? value : [value]; - }) - ); + const samlOrgas = R.path(orgaPath, profile) || []; + const availableOrgas = Array.isArray(samlOrgas) ? samlOrgas : [samlOrgas]; const orgasMapper = genConfigMapper(orgasMapping); return [...orgaDefault, ...availableOrgas.map((a) => orgasMapper[a]).filter((r) => isNotEmptyField(r))]; };