diff --git a/backend/src/ee/services/scim/scim-service.ts b/backend/src/ee/services/scim/scim-service.ts index c542b2340..1ca881ed0 100644 --- a/backend/src/ee/services/scim/scim-service.ts +++ b/backend/src/ee/services/scim/scim-service.ts @@ -429,6 +429,15 @@ export const scimServiceFactory = ({ }); } + const organization = await orgDAL.findById(scimToken.orgId); + + if (!organization.scimEnabled) { + throw new ScimRequestError({ + detail: "SCIM is disabled for the organization", + status: 403 + }); + } + return { scimTokenId: scimToken.id, orgId: scimToken.orgId }; };