Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: resolved entra scim replace issue

=b8d427c193b1
diff --git a/backend/src/ee/routes/v1/scim-router.ts b/backend/src/ee/routes/v1/scim-router.ts
index 2f7ab9dcce..0c784a476a 100644
--- a/backend/src/ee/routes/v1/scim-router.ts
+++ b/backend/src/ee/routes/v1/scim-router.ts
@@ -475,6 +475,9 @@ export const registerScimRouter = async (server: FastifyZodProvider) => {
params: z.object({
groupId: z.string().trim()
}),
+ querystring: z.object({
+ excludedAttributes: z.string().trim().optional()
+ }),
response: {
200: ScimGroupSchema
}
@@ -483,7 +486,8 @@ export const registerScimRouter = async (server: FastifyZodProvider) => {
handler: async (req) => {
const group = await req.server.services.scim.getScimGroup({
groupId: req.params.groupId,
- orgId: req.permission.orgId
+ orgId: req.permission.orgId,
+ isMembersExcluded: req.query.excludedAttributes === "members"
});
return group;
diff --git a/backend/src/ee/services/scim/scim-service.ts b/backend/src/ee/services/scim/scim-service.ts
index 0f8c9e9357..f08bd5d825 100644
--- a/backend/src/ee/services/scim/scim-service.ts
+++ b/backend/src/ee/services/scim/scim-service.ts
@@ -1138,7 +1138,7 @@ export const scimServiceFactory = ({
});
};
- const getScimGroup: TScimServiceFactory["getScimGroup"] = async ({ groupId, orgId }) => {
+ const getScimGroup: TScimServiceFactory["getScimGroup"] = async ({ groupId, orgId, isMembersExcluded }) => {
const plan = await licenseService.getPlan(orgId);
if (!plan.groups)
throw new BadRequestError({
@@ -1157,6 +1157,27 @@ export const scimServiceFactory = ({
});
}
+ if (isMembersExcluded) {
+ await scimEventsDAL.create({
+ orgId,
+ eventType: ScimEvent.GET_GROUP,
+ event: {
+ groupName: group.name,
+ numberOfMembers: 0
+ }
+ });
+
+ const scimGroup = buildScimGroup({
+ groupId: group.id,
+ name: group.name,
+ members: [],
+ createdAt: group.createdAt,
+ updatedAt: group.updatedAt
+ });
+ const { members, ...scimGroupWithoutMembers } = scimGroup;
+ return scimGroupWithoutMembers as TScimGroup;
+ }
+
const users = await groupDAL
.findAllGroupPossibleUsers({
orgId: group.orgId,
diff --git a/backend/src/ee/services/scim/scim-types.ts b/backend/src/ee/services/scim/scim-types.ts
index bbdb48422f..48e7f3fbbc 100644
--- a/backend/src/ee/services/scim/scim-types.ts
+++ b/backend/src/ee/services/scim/scim-types.ts
@@ -114,6 +114,7 @@ export type TCreateScimGroupDTO = {
export type TGetScimGroupDTO = {
groupId: string;
orgId: string;
+ isMembersExcluded?: boolean;
};
export type TUpdateScimGroupNamePutDTO = {
diff --git a/docs/documentation/platform/scim/azure.mdx b/docs/documentation/platform/scim/azure.mdx
index e755f8750b..1364b5a07c 100644
--- a/docs/documentation/platform/scim/azure.mdx
+++ b/docs/documentation/platform/scim/azure.mdx
@@ -43,9 +43,10 @@ Prerequisites:
Next, set the following fields:
- Provisioning Mode: Select **Automatic**.
- - Tenant URL: Input **SCIM URL** from Step 1.
+ - Tenant URL: Input the **Microsoft Entra ID (Azure) Tenant URL** from Step 1
+ (attach the SCIM URL with the `?aadOptscim062020` query parameter appended).
- Secret Token: Input the **New SCIM Token** from Step 1.
-
+
Afterwards, click **Enable SCIM** and press the **Test Connection** button to check that SCIM is configured properly.
![SCIM Azure](/images/platform/scim/azure/scim-azure-config.png)