Skip to content

Commit

Permalink
[backend] Fix SAML organization mappings (#9042)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Nov 16, 2024
1 parent 9cab8d4 commit 1086daf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions opencti-platform/opencti-graphql/src/config/providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))];
};
Expand Down

0 comments on commit 1086daf

Please sign in to comment.