Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore: move scim code out of ee/ (#120350)

Reece Jones3901bb5fddcc
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 03a661fbebd8..259ff2056a99 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -56,7 +56,7 @@ rust/persons_migrations/** @PostHog/team-ingestion
ee/api/authentication.py @PostHog/team-security
posthog/api/authentication.py @PostHog/team-security
posthog/auth.py @PostHog/team-security
-ee/api/scim/auth.py @PostHog/team-security
+posthog/api/scim/auth.py @PostHog/team-security
# The Content Security Policy every app and admin page carries. A browser refuses a resource the
# policy does not name and shows the user no error, so a policy mistake breaks a feature with no
diff --git a/.semgrep/rules/devex/user-email-lookups-use-the-shared-fold.yaml b/.semgrep/rules/devex/user-email-lookups-use-the-shared-fold.yaml
index e9c85a90555e..157bea024a4b 100644
--- a/.semgrep/rules/devex/user-email-lookups-use-the-shared-fold.yaml
+++ b/.semgrep/rules/devex/user-email-lookups-use-the-shared-fold.yaml
@@ -36,7 +36,7 @@ rules:
include:
- /ee/api/agentic_provisioning/**/*.py
- /ee/api/authentication.py
- - /ee/api/scim/**/*.py
+ - /posthog/api/scim/**/*.py
- /ee/partners/stripe/api/provisioning/**/*.py
- /posthog/api/authentication.py
- /posthog/api/id_jag.py
diff --git a/ee/api/authentication.py b/ee/api/authentication.py
index 0798aaf9c76b..18af63b4ee54 100644
--- a/ee/api/authentication.py
+++ b/ee/api/authentication.py
@@ -32,6 +32,7 @@ from social_django.models import UserSocialAuth
from social_django.strategy import DjangoStrategy
from social_django.utils import load_backend, load_strategy
+from posthog.api.scim.utils import mask_email
from posthog.cloud_utils import get_cached_instance_license
from posthog.constants import AvailableFeature
from posthog.exceptions_capture import capture_exception
@@ -43,7 +44,6 @@ from posthog.models.organization import OrganizationMembership
from posthog.models.organization_domain import OrganizationDomain
from ee import settings
-from ee.api.scim.utils import mask_email
from ee.api.vercel.types import VercelClaims, VercelSystemClaims, VercelUser, VercelUserClaims
from ee.api.vercel.utils import get_vercel_jwks
diff --git a/ee/migrations/0067_remove_scimrequestlog_identity_provider_config_and_more.py b/ee/migrations/0067_remove_scimrequestlog_identity_provider_config_and_more.py
new file mode 100644
index 000000000000..3bcc1389b23e
--- /dev/null
+++ b/ee/migrations/0067_remove_scimrequestlog_identity_provider_config_and_more.py
@@ -0,0 +1,32 @@
+# Generated by Django 5.2.18 on 2026-10-20 13:32
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("ee", "0066_remove_dashboardprivilege"),
+ ("posthog", "1407_scimprovisioneduser_scimrequestlog"),
+ ]
+
+ operations = [
+ migrations.SeparateDatabaseAndState(
+ database_operations=[],
+ state_operations=[
+ migrations.RemoveField(
+ model_name="scimrequestlog",
+ name="identity_provider_config",
+ ),
+ migrations.RemoveField(
+ model_name="scimrequestlog",
+ name="organization_domain",
+ ),
+ migrations.DeleteModel(
+ name="SCIMProvisionedUser",
+ ),
+ migrations.DeleteModel(
+ name="SCIMRequestLog",
+ ),
+ ],
+ ),
+ ]
diff --git a/ee/migrations/max_migration.txt b/ee/migrations/max_migration.txt
index 0346250b1d43..de272df57a2a 100644
--- a/ee/migrations/max_migration.txt
+++ b/ee/migrations/max_migration.txt
@@ -1 +1 @@
-0066_remove_dashboardprivilege
+0067_remove_scimrequestlog_identity_provider_config_and_more
diff --git a/ee/models/__init__.py b/ee/models/__init__.py
index 2ea8b15f1654..08f762fa639e 100644
--- a/ee/models/__init__.py
+++ b/ee/models/__init__.py
@@ -2,14 +2,10 @@ from .event_definition import EnterpriseEventDefinition
from .explicit_team_membership import ExplicitTeamMembership
from .license import License
from .property_definition import EnterprisePropertyDefinition
-from .scim_provisioned_user import SCIMProvisionedUser
-from .scim_request_log import SCIMRequestLog
__all__ = [
"EnterpriseEventDefinition",
"EnterprisePropertyDefinition",
"ExplicitTeamMembership",
"License",
- "SCIMProvisionedUser",
- "SCIMRequestLog",
]
diff --git a/ee/settings.py b/ee/settings.py
index d122bb54d579..23f9f12f198e 100644
--- a/ee/settings.py
+++ b/ee/settings.py
@@ -153,20 +153,3 @@ VERCEL_CLIENT_INTEGRATION_ID = get_from_env("VERCEL_CLIENT_INTEGRATION_ID", "",
VERCEL_CLIENT_INTEGRATION_SECRET = get_from_env("VERCEL_CLIENT_INTEGRATION_SECRET", "", type_cast=str)
VERCEL_INTEGRATION_SLUG = get_from_env("VERCEL_INTEGRATION_SLUG", "posthog", type_cast=str)
BILLING_PROVIDER_WEBHOOK_SECRET = get_from_env("BILLING_PROVIDER_WEBHOOK_SECRET", "", type_cast=str)
-
-# SCIM Configuration
-# django-scim2 requires these settings
-SCIM_SERVICE_PROVIDER = {
- "NETLOC": SITE_URL.replace("http://", "").replace("https://", ""),
- "AUTHENTICATION_SCHEMES": [
- {
- "type": "oauthbearertoken",
- "name": "OAuth Bearer Token",
- "description": "Authentication scheme using the OAuth Bearer Token Standard",
- "specUri": "https://www.rfc-editor.org/rfc/rfc6750.txt",
- "documentationUri": "https://posthog.com/docs/settings/scim",
- }
- ],
- # User model is already configured via AUTH_USER_MODEL = "posthog.User"
- "GROUP_MODEL": "products.access_control.backend.models.role.Role",
-}
diff --git a/ee/urls.py b/ee/urls.py
index fe401c1cc5b5..12ab4efd6a6a 100644
--- a/ee/urls.py
+++ b/ee/urls.py
@@ -26,7 +26,6 @@ from ee.middleware import admin_oauth2_callback
from ee.support_sidebar_max.views import MaxChatViewSet
from .api import authentication, billing, conversation, core_memory, organization_billing, project_billing
-from .api.scim import views as scim_views
def extend_api_router() -> None:
@@ -191,29 +190,6 @@ urlpatterns: list[Any] = [
vercel_connect.VercelConnectLinkViewSet.as_view({"get": "session_info"}),
),
path("webhooks/vercel", build_webhook_view(build_vercel_provider()), name="vercel_webhooks"),
- path("scim/v2/<str:scim_slug>/Users", csrf_exempt(scim_views.SCIMUsersView.as_view()), name="scim_users"),
- path(
- "scim/v2/<str:scim_slug>/Users/<int:user_id>",
- csrf_exempt(scim_views.SCIMUserDetailView.as_view()),
- name="scim_user_detail",
- ),
- path("scim/v2/<str:scim_slug>/Groups", csrf_exempt(scim_views.SCIMGroupsView.as_view()), name="scim_groups"),
- path(
- "scim/v2/<str:scim_slug>/Groups/<uuid:group_id>",
- csrf_exempt(scim_views.SCIMGroupDetailView.as_view()),
- name="scim_group_detail",
- ),
- path(
- "scim/v2/<str:scim_slug>/ServiceProviderConfig",
- csrf_exempt(scim_views.SCIMServiceProviderConfigView.as_view()),
- name="scim_service_provider_config",
- ),
- path(
- "scim/v2/<str:scim_slug>/ResourceTypes",
- csrf_exempt(scim_views.SCIMResourceTypesView.as_view()),
- name="scim_resource_types",
- ),
- path("scim/v2/<str:scim_slug>/Schemas", csrf_exempt(scim_views.SCIMSchemasView.as_view()), name="scim_schemas"),
# Stripe Projects provisioning (APP 0.1d)
path("api/partners/stripe/", include("ee.partners.stripe.api.provisioning.urls")),
# Agentic provisioning (partner account/resource provisioning + deep-link login)
diff --git a/posthog/admin/inlines/scim_provisioned_user_inline.py b/posthog/admin/inlines/scim_provisioned_user_inline.py
index 7bdd03010da4..3eda22c96990 100644
--- a/posthog/admin/inlines/scim_provisioned_user_inline.py
+++ b/posthog/admin/inlines/scim_provisioned_user_inline.py
@@ -1,6 +1,6 @@
from django.contrib import admin
-from ee.models.scim_provisioned_user import SCIMProvisionedUser
+from posthog.models.scim_provisioned_user import SCIMProvisionedUser
class SCIMProvisionedUserInline(admin.TabularInline):
diff --git a/posthog/api/identity_provider_config.py b/posthog/api/identity_provider_config.py
index 6d48974c86b9..5c5542963f72 100644
--- a/posthog/api/identity_provider_config.py
+++ b/posthog/api/identity_provider_config.py
@@ -11,6 +11,12 @@ from rest_framework.request import Request
from rest_framework.viewsets import ModelViewSet
from posthog.api.routing import TeamAndOrgViewSetMixin
+from posthog.api.scim.utils import (
+ disable_scim_for_config,
+ enable_scim_for_config,
+ get_scim_base_url,
+ regenerate_scim_token_for_config,
+)
from posthog.api.scim_request_log import (
PaginatedSCIMRequestLogSerializer,
SCIMRequestLogQuerySerializer,
@@ -30,18 +36,11 @@ from posthog.models.identity_provider_config import (
from posthog.models.linked_identity_provider_config import LinkedIdentityProviderConfig
from posthog.models.organization import Organization, OrganizationMembership
from posthog.models.organization_domain import OrganizationDomain
+from posthog.models.scim_request_log import SCIMRequestLog
from posthog.models.user import User
from posthog.permissions import OrganizationAdminWritePermissions, TimeSensitiveActionPermission
from posthog.security.url_validation import is_url_allowed
-from ee.api.scim.utils import (
- disable_scim_for_config,
- enable_scim_for_config,
- get_scim_base_url,
- regenerate_scim_token_for_config,
-)
-from ee.models.scim_request_log import SCIMRequestLog
-
def _capture_idp_config_event(
request: Request, config: IdentityProviderConfig, event_type: str, properties: dict | None = None
diff --git a/posthog/api/organization_domain.py b/posthog/api/organization_domain.py
index af16ab72ff24..3adce0ea9fe6 100644
--- a/posthog/api/organization_domain.py
+++ b/posthog/api/organization_domain.py
@@ -10,6 +10,7 @@ from rest_framework.request import Request
from rest_framework.viewsets import ModelViewSet
from posthog.api.routing import TeamAndOrgViewSetMixin
+from posthog.api.scim.utils import get_scim_base_url
from posthog.api.scim_request_log import (
PaginatedSCIMRequestLogSerializer,
SCIMRequestLogQuerySerializer,
@@ -22,11 +23,9 @@ from posthog.event_usage import groups
from posthog.models import OrganizationDomain, User
from posthog.models.identity_provider_config import ConfigScope
from posthog.models.organization import Organization, OrganizationMembership
+from posthog.models.scim_request_log import SCIMRequestLog
from posthog.permissions import OrganizationAdminWritePermissions, TimeSensitiveActionPermission
-from ee.api.scim.utils import get_scim_base_url
-from ee.models.scim_request_log import SCIMRequestLog
-
DOMAIN_REGEX = r"^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$"
diff --git a/ee/api/scim/README.md b/posthog/api/scim/README.md
similarity index 95%
rename from ee/api/scim/README.md
rename to posthog/api/scim/README.md
index 822b8413e75e..c6203ddcee7a 100644
--- a/ee/api/scim/README.md
+++ b/posthog/api/scim/README.md
@@ -42,8 +42,8 @@ SCIM 2.0 (System for Cross-domain Identity Management) enables automated user pr
### Models
- `posthog/models/identity_provider_config.py` - Stores `scim_enabled`, `scim_bearer_token`, and `scim_slug`
-- `ee/models/scim_provisioned_user.py` - One provisioning record per (user, config)
-- `ee/models/scim_request_log.py` - Request log per config, listed per domain in the UI
+- `posthog/models/scim_provisioned_user.py` - One provisioning record per (user, config)
+- `posthog/models/scim_request_log.py` - Request log per config, listed per domain in the UI
Both carry a legacy `organization_domain` from when SCIM was addressed per domain. Provisioning
records are attributed to their config by migration `ee.0058`; request logs by the
@@ -58,7 +58,7 @@ python manage.py backfill_scim_request_log_config --batch-size 1000 --sleep 0.1
It is resumable and safe to re-run. Until it has finished, the per-domain log listing reads both
keys, so no history is hidden while it works.
-### Core SCIM Implementation (`ee/api/scim/`)
+### Core SCIM Implementation (`posthog/api/scim/`)
- `auth.py` - Bearer token authentication
- `user.py` - SCIM User adapter (maps to PostHog User model)
@@ -74,13 +74,13 @@ keys, so no history is hidden while it works.
### Configuration
-- `ee/urls.py` - SCIM URL routing
-- `ee/settings.py` - SCIM service provider config
+- `posthog/urls.py` - SCIM URL routing
+- `posthog/settings/__init__.py` - SCIM service provider config
- `pyproject.toml` - Added `django-scim2==0.19.0` dependency
### Testing
-- `ee/api/scim/test/test_scim_api.py` - Comprehensive SCIM endpoint tests
+- `posthog/api/scim/test/test_scim_api.py` - Comprehensive SCIM endpoint tests
## API Endpoints
@@ -375,9 +375,9 @@ This allows for a hybrid approach where users can access the organization immedi
Run tests:
```bash
-pytest ee/api/scim/test/test_scim_api.py
-pytest ee/api/scim/test/test_users_api.py
-pytest ee/api/scim/test/test_groups_api.py
+pytest posthog/api/scim/test/test_scim_api.py
+pytest posthog/api/scim/test/test_users_api.py
+pytest posthog/api/scim/test/test_groups_api.py
```
## IdP Configuration Guide
diff --git a/ee/api/scim/__init__.py b/posthog/api/scim/__init__.py
similarity index 100%
rename from ee/api/scim/__init__.py
rename to posthog/api/scim/__init__.py
diff --git a/ee/api/scim/auth.py b/posthog/api/scim/auth.py
similarity index 100%
rename from ee/api/scim/auth.py
rename to posthog/api/scim/auth.py
diff --git a/ee/api/scim/group.py b/posthog/api/scim/group.py
similarity index 100%
rename from ee/api/scim/group.py
rename to posthog/api/scim/group.py
diff --git a/ee/api/scim/test/__init__.py b/posthog/api/scim/test/__init__.py
similarity index 100%
rename from ee/api/scim/test/__init__.py
rename to posthog/api/scim/test/__init__.py
diff --git a/ee/api/scim/test/test_groups_api.py b/posthog/api/scim/test/test_groups_api.py
similarity index 99%
rename from ee/api/scim/test/test_groups_api.py
rename to posthog/api/scim/test/test_groups_api.py
index 4d27d66b3efa..2ecf5139b2b8 100644
--- a/ee/api/scim/test/test_groups_api.py
+++ b/posthog/api/scim/test/test_groups_api.py
@@ -3,6 +3,9 @@ import uuid
from parameterized import parameterized
from rest_framework import status
+from posthog.api.scim.auth import generate_scim_token
+from posthog.api.scim.group import PostHogSCIMGroup
+from posthog.api.scim.views import MAX_ITEMS_PER_PAGE
from posthog.constants import AvailableFeature
from posthog.models import Organization, OrganizationMembership, User
from posthog.models.identity_provider_config import IdentityProviderConfig
@@ -11,9 +14,6 @@ from posthog.models.organization_domain import OrganizationDomain
from products.access_control.backend.models.role import Role, RoleMembership
-from ee.api.scim.auth import generate_scim_token
-from ee.api.scim.group import PostHogSCIMGroup
-from ee.api.scim.views import MAX_ITEMS_PER_PAGE
from ee.api.test.base import APILicensedTest
diff --git a/ee/api/scim/test/test_scim_api.py b/posthog/api/scim/test/test_scim_api.py
similarity index 99%
rename from ee/api/scim/test/test_scim_api.py
rename to posthog/api/scim/test/test_scim_api.py
index 4ba2a2dd04a5..1a36089e2037 100644
--- a/ee/api/scim/test/test_scim_api.py
+++ b/posthog/api/scim/test/test_scim_api.py
@@ -1,6 +1,9 @@
from parameterized import parameterized
from rest_framework import status
+from posthog.api.scim.auth import SCIMBearerTokenAuthentication, generate_scim_token
+from posthog.api.scim.user import PostHogSCIMUser
+from posthog.api.scim.utils import get_scim_base_url
from posthog.constants import AvailableFeature
from posthog.models import Organization, OrganizationMembership, User
from posthog.models.activity_logging.activity_log import ActivityLog
@@ -11,9 +14,6 @@ from posthog.test.authentication_checks import covers_authentication
from products.access_control.backend.models.role import Role
-from ee.api.scim.auth import SCIMBearerTokenAuthentication, generate_scim_token
-from ee.api.scim.user import PostHogSCIMUser
-from ee.api.scim.utils import get_scim_base_url
from ee.api.test.base import APILicensedTest
@@ -488,7 +488,7 @@ class TestSCIMEmailDomainValidation(APILicensedTest):
"""Create a user whose current email domain is not owned by the SCIM org."""
user = User.objects.create(email="[email protected]", first_name="Victim")
OrganizationMembership.objects.create(user=user, organization=self.organization)
- from ee.models.scim_provisioned_user import SCIMProvisionedUser
+ from posthog.models.scim_provisioned_user import SCIMProvisionedUser
SCIMProvisionedUser.objects.create(
user=user,
diff --git a/ee/api/scim/test/test_scim_legacy_records.py b/posthog/api/scim/test/test_scim_legacy_records.py
similarity index 99%
rename from ee/api/scim/test/test_scim_legacy_records.py
rename to posthog/api/scim/test/test_scim_legacy_records.py
index 460904e10038..774a82e67a56 100644
--- a/ee/api/scim/test/test_scim_legacy_records.py
+++ b/posthog/api/scim/test/test_scim_legacy_records.py
@@ -1,15 +1,15 @@
from parameterized import parameterized
from rest_framework import status
+from posthog.api.scim.auth import generate_scim_token
from posthog.constants import AvailableFeature
from posthog.models import OrganizationMembership, User
from posthog.models.identity_provider_config import IdentityProviderConfig
from posthog.models.linked_identity_provider_config import LinkedIdentityProviderConfig
from posthog.models.organization_domain import OrganizationDomain
+from posthog.models.scim_provisioned_user import SCIMProvisionedUser
-from ee.api.scim.auth import generate_scim_token
from ee.api.test.base import APILicensedTest
-from ee.models.scim_provisioned_user import SCIMProvisionedUser
class TestSCIMRecordsWrittenBeforeConfigs(APILicensedTest):
diff --git a/ee/api/scim/test/test_scim_request_log.py b/posthog/api/scim/test/test_scim_request_log.py
similarity index 97%
rename from ee/api/scim/test/test_scim_request_log.py
rename to posthog/api/scim/test/test_scim_request_log.py
index b3ae15021bfb..746ce3c7bf59 100644
--- a/ee/api/scim/test/test_scim_request_log.py
+++ b/posthog/api/scim/test/test_scim_request_log.py
@@ -8,17 +8,17 @@ from django.utils import timezone
from parameterized import parameterized
from rest_framework import status
+from posthog.api.scim.auth import generate_scim_token
from posthog.constants import AvailableFeature
from posthog.models import Organization
from posthog.models.identity_provider_config import IdentityProviderConfig
from posthog.models.linked_identity_provider_config import LinkedIdentityProviderConfig
from posthog.models.organization import OrganizationMembership
from posthog.models.organization_domain import OrganizationDomain
+from posthog.models.scim_request_log import SCIMRequestLog
+from posthog.tasks.scim_request_log_cleanup import cleanup_old_scim_request_logs
-from ee.api.scim.auth import generate_scim_token
from ee.api.test.base import APILicensedTest
-from ee.models.scim_request_log import SCIMRequestLog
-from ee.tasks.scim_request_log_cleanup import cleanup_old_scim_request_logs
class TestSCIMRequestLogCapture(APILicensedTest):
@@ -167,7 +167,7 @@ class TestSCIMRequestLogCleanup(TestCase):
def test_cleanup_batches_deletes(self):
for _ in range(5):
self._create_log(200)
- with patch("ee.tasks.scim_request_log_cleanup.CLEANUP_BATCH_SIZE", 2):
+ with patch("posthog.tasks.scim_request_log_cleanup.CLEANUP_BATCH_SIZE", 2):
cleanup_old_scim_request_logs()
assert SCIMRequestLog.objects.filter(identity_provider_config=self.config).count() == 0
diff --git a/ee/api/scim/test/test_scim_utils.py b/posthog/api/scim/test/test_scim_utils.py
similarity index 99%
rename from ee/api/scim/test/test_scim_utils.py
rename to posthog/api/scim/test/test_scim_utils.py
index 12019ffe8a51..092fecc0ac9f 100644
--- a/ee/api/scim/test/test_scim_utils.py
+++ b/posthog/api/scim/test/test_scim_utils.py
@@ -1,6 +1,6 @@
from parameterized import parameterized
-from ee.api.scim.utils import (
+from posthog.api.scim.utils import (
mask_email,
mask_headers,
mask_pii_value,
diff --git a/ee/api/scim/test/test_users_api.py b/posthog/api/scim/test/test_users_api.py
similarity index 99%
rename from ee/api/scim/test/test_users_api.py
rename to posthog/api/scim/test/test_users_api.py
index b4822f4cb44e..8f940768f0cf 100644
--- a/ee/api/scim/test/test_users_api.py
+++ b/posthog/api/scim/test/test_users_api.py
@@ -1,20 +1,20 @@
from parameterized import parameterized
from rest_framework import status
+from posthog.api.scim.auth import generate_scim_token
+from posthog.api.scim.views import MAX_ITEMS_PER_PAGE
from posthog.constants import AvailableFeature
from posthog.models import Organization, OrganizationMembership, User
from posthog.models.identity_provider_config import IdentityProviderConfig
from posthog.models.linked_identity_provider_config import LinkedIdentityProviderConfig
from posthog.models.organization_domain import OrganizationDomain
+from posthog.models.scim_provisioned_user import SCIMProvisionedUser
from products.access_control.backend.facade.user_access_control import UserAccessControl
from products.access_control.backend.models.access_control import AccessControl
from products.access_control.backend.models.role import RoleMembership
-from ee.api.scim.auth import generate_scim_token
-from ee.api.scim.views import MAX_ITEMS_PER_PAGE
from ee.api.test.base import APILicensedTest
-from ee.models.scim_provisioned_user import SCIMProvisionedUser
class TestSCIMUsersAPI(APILicensedTest):
diff --git a/ee/api/scim/user.py b/posthog/api/scim/user.py
similarity index 99%
rename from ee/api/scim/user.py
rename to posthog/api/scim/user.py
index f04c48c16d4e..bb3ed9246c16 100644
--- a/ee/api/scim/user.py
+++ b/posthog/api/scim/user.py
@@ -11,11 +11,10 @@ from posthog.helpers.email_utils import EmailLookupHandler, EmailNormalizer
from posthog.models import Organization, OrganizationMembership, User
from posthog.models.identity_provider_config import IdentityProviderConfig
from posthog.models.organization_domain import OrganizationDomain
+from posthog.models.scim_provisioned_user import SCIMProvisionedUser
from products.access_control.backend.models.role import RoleMembership
-from ee.models.scim_provisioned_user import SCIMProvisionedUser
-
class SCIMUserConflict(Exception):
"""User is already SCIM-provisioned for this identity provider configuration."""
diff --git a/ee/api/scim/utils.py b/posthog/api/scim/utils.py
similarity index 98%
rename from ee/api/scim/utils.py
rename to posthog/api/scim/utils.py
index 9873c38169ce..fbfe19d13b0d 100644
--- a/ee/api/scim/utils.py
+++ b/posthog/api/scim/utils.py
@@ -5,8 +5,7 @@ from django.conf import settings
from rest_framework.request import Request
from posthog.models.identity_provider_config import IdentityProviderConfig
-
-from ee.models.scim_provisioned_user import SCIMProvisionedUser
+from posthog.models.scim_provisioned_user import SCIMProvisionedUser
from .auth import generate_scim_token
diff --git a/ee/api/scim/views.py b/posthog/api/scim/views.py
similarity index 98%
rename from ee/api/scim/views.py
rename to posthog/api/scim/views.py
index 3016fd6ed930..0602b682b2f8 100644
--- a/ee/api/scim/views.py
+++ b/posthog/api/scim/views.py
@@ -18,27 +18,26 @@ from rest_framework.response import Response
from rest_framework.views import APIView
from scim2_filter_parser.transpilers.django_q_object import get_query
+from posthog.api.scim.auth import SCIMBearerTokenAuthentication
+from posthog.api.scim.group import PostHogSCIMGroup
+from posthog.api.scim.user import PostHogSCIMUser, SCIMUserConflict
+from posthog.api.scim.utils import (
+ detect_identity_provider,
+ mask_headers,
+ mask_scim_filter,
+ mask_scim_payload,
+ normalize_scim_operations,
+)
from posthog.dataclasses import frozen
from posthog.exceptions_capture import capture_exception
from posthog.models import User
from posthog.models.activity_logging.activity_log import ActivityContextBase, Detail, log_activity
from posthog.models.identity_provider_config import IdentityProviderConfig
+from posthog.models.scim_provisioned_user import SCIMProvisionedUser
+from posthog.models.scim_request_log import SCIMRequestLog
from products.access_control.backend.models.role import Role
-from ee.api.scim.auth import SCIMBearerTokenAuthentication
-from ee.api.scim.group import PostHogSCIMGroup
-from ee.api.scim.user import PostHogSCIMUser, SCIMUserConflict
-from ee.api.scim.utils import (
- detect_identity_provider,
- mask_headers,
- mask_scim_filter,
- mask_scim_payload,
- normalize_scim_operations,
-)
-from ee.models.scim_provisioned_user import SCIMProvisionedUser
-from ee.models.scim_request_log import SCIMRequestLog
-
logger = structlog.get_logger(__name__)
MAX_ITEMS_PER_PAGE = 200
diff --git a/posthog/api/scim_request_log.py b/posthog/api/scim_request_log.py
index 07d1330eafc3..2be93b5a0991 100644
--- a/posthog/api/scim_request_log.py
+++ b/posthog/api/scim_request_log.py
@@ -5,8 +5,8 @@ from rest_framework import response, serializers
from rest_framework.pagination import PageNumberPagination
from rest_framework.request import Request
-from ee.api.scim.utils import mask_email, mask_string
-from ee.models.scim_request_log import SCIMRequestLog
+from posthog.api.scim.utils import mask_email, mask_string
+from posthog.models.scim_request_log import SCIMRequestLog
class SCIMRequestLogSerializer(serializers.ModelSerializer):
diff --git a/posthog/api/test/test_identity_provider_config.py b/posthog/api/test/test_identity_provider_config.py
index 16a375255565..4c26ee7edac3 100644
--- a/posthog/api/test/test_identity_provider_config.py
+++ b/posthog/api/test/test_identity_provider_config.py
@@ -14,9 +14,8 @@ from posthog.models import (
OrganizationDomain,
OrganizationMembership,
)
-
-from ee.models.scim_provisioned_user import SCIMProvisionedUser
-from ee.models.scim_request_log import SCIMRequestLog
+from posthog.models.scim_provisioned_user import SCIMProvisionedUser
+from posthog.models.scim_request_log import SCIMRequestLog
class TestIdentityProviderConfigAPI(APIBaseTest):
diff --git a/posthog/api/test/test_organization_domain.py b/posthog/api/test/test_organization_domain.py
index 269d7f9052b4..40a6fd5db76a 100644
--- a/posthog/api/test/test_organization_domain.py
+++ b/posthog/api/test/test_organization_domain.py
@@ -16,9 +16,9 @@ from rest_framework import serializers, status
from posthog.api.organization_domain import OrganizationDomainSerializer, OrganizationDomainViewset
from posthog.models import Organization, OrganizationDomain, OrganizationMembership, Team
+from posthog.models.scim_request_log import SCIMRequestLog
from ee.api.test.base import APILicensedTest
-from ee.models.scim_request_log import SCIMRequestLog
class FakeAnswer:
diff --git a/ee/management/commands/backfill_scim_request_log_config.py b/posthog/management/commands/backfill_scim_request_log_config.py
similarity index 98%
rename from ee/management/commands/backfill_scim_request_log_config.py
rename to posthog/management/commands/backfill_scim_request_log_config.py
index 6e5ac01854ad..d8407343cb7d 100644
--- a/ee/management/commands/backfill_scim_request_log_config.py
+++ b/posthog/management/commands/backfill_scim_request_log_config.py
@@ -27,8 +27,7 @@ from django.db.models import OuterRef, Subquery
import structlog
from posthog.models.linked_identity_provider_config import LinkedIdentityProviderConfig
-
-from ee.models.scim_request_log import SCIMRequestLog
+from posthog.models.scim_request_log import SCIMRequestLog
logger = structlog.get_logger(__name__)
diff --git a/ee/management/commands/test/test_backfill_scim_request_log_config.py b/posthog/management/commands/test/test_backfill_scim_request_log_config.py
similarity index 98%
rename from ee/management/commands/test/test_backfill_scim_request_log_config.py
rename to posthog/management/commands/test/test_backfill_scim_request_log_config.py
index 57c3c02303ee..0e4c103772f7 100644
--- a/ee/management/commands/test/test_backfill_scim_request_log_config.py
+++ b/posthog/management/commands/test/test_backfill_scim_request_log_config.py
@@ -8,8 +8,7 @@ from posthog.models import Organization
from posthog.models.identity_provider_config import IdentityProviderConfig
from posthog.models.linked_identity_provider_config import LinkedIdentityProviderConfig
from posthog.models.organization_domain import OrganizationDomain
-
-from ee.models.scim_request_log import SCIMRequestLog
+from posthog.models.scim_request_log import SCIMRequestLog
class TestBackfillSCIMRequestLogConfig(BaseTest):
diff --git a/posthog/migrations/1407_scimprovisioneduser_scimrequestlog.py b/posthog/migrations/1407_scimprovisioneduser_scimrequestlog.py
new file mode 100644
index 000000000000..a095b7e3fc0e
--- /dev/null
+++ b/posthog/migrations/1407_scimprovisioneduser_scimrequestlog.py
@@ -0,0 +1,228 @@
+# Generated by Django 5.2.18 on 2026-10-20 13:32
+
+import django.db.models.deletion
+from django.conf import settings
+from django.db import migrations, models
+
+import posthog.uuidt
+
+MODELS_TO_MOVE = ("scimprovisioneduser", "scimrequestlog")
+
+
+def _copy_permission_assignments(apps, db_alias, source_permission, target_permission):
+ User = apps.get_model("posthog", "User")
+ Group = apps.get_model("auth", "Group")
+ assignment_models = (
+ (User._meta.get_field("user_permissions").remote_field.through, "user_id"),
+ (Group._meta.get_field("permissions").remote_field.through, "group_id"),
+ )
+
+ for assignment_model, assignee_field in assignment_models:
+ assignee_ids = (
+ assignment_model.objects.using(db_alias)
+ .filter(permission_id=source_permission.pk)
+ .values_list(assignee_field, flat=True)
+ )
+ assignment_model.objects.using(db_alias).bulk_create(
+ [
+ assignment_model(**{assignee_field: assignee_id, "permission_id": target_permission.pk})
+ for assignee_id in assignee_ids
+ ],
+ ignore_conflicts=True,
+ )
+
+
+def _merge_permissions(apps, db_alias, source, target):
+ Permission = apps.get_model("auth", "Permission")
+
+ for source_permission in Permission.objects.using(db_alias).filter(content_type=source):
+ target_permission = (
+ Permission.objects.using(db_alias).filter(content_type=target, codename=source_permission.codename).first()
+ )
+ if target_permission:
+ _copy_permission_assignments(apps, db_alias, source_permission, target_permission)
+ source_permission.delete(using=db_alias)
+ else:
+ source_permission.content_type = target
+ source_permission.save(using=db_alias, update_fields=["content_type"])
+
+
+def _move_content_types(apps, schema_editor, from_label, to_label):
+ db_alias = schema_editor.connection.alias
+ ContentType = apps.get_model("contenttypes", "ContentType")
+
+ for model_name in MODELS_TO_MOVE:
+ source = ContentType.objects.using(db_alias).filter(app_label=from_label, model=model_name).first()
+ target = ContentType.objects.using(db_alias).filter(app_label=to_label, model=model_name).first()
+
+ if source and target:
+ _merge_permissions(apps, db_alias, source, target)
+ source.delete(using=db_alias)
+ elif source:
+ source.app_label = to_label
+ source.save(using=db_alias)
+
+
+def update_content_types(apps, schema_editor):
+ _move_content_types(apps, schema_editor, "ee", "posthog")
+
+
+def reverse_content_types(apps, schema_editor):
+ _move_content_types(apps, schema_editor, "posthog", "ee")
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("posthog", "1406_file_system_team_text_trgm_index"),
+ ("ee", "0064_split_identity_provider_config_scopes"),
+ ]
+
+ operations = [
+ migrations.SeparateDatabaseAndState(
+ database_operations=[],
+ state_operations=[
+ migrations.CreateModel(
+ name="SCIMProvisionedUser",
+ fields=[
+ ("updated_at", models.DateTimeField(auto_now=True, null=True)),
+ (
+ "id",
+ models.UUIDField(
+ default=posthog.uuidt.uuid7,
+ editable=False,
+ primary_key=True,
+ serialize=False,
+ ),
+ ),
+ (
+ "identity_provider",
+ models.CharField(
+ choices=[
+ ("okta", "Okta"),
+ ("entra_id", "Microsoft Entra ID"),
+ ("google", "Google Workspace"),
+ ("onelogin", "OneLogin"),
+ ("other", "Other"),
+ ],
+ max_length=50,
+ ),
+ ),
+ ("username", models.CharField(max_length=255)),
+ ("active", models.BooleanField(default=True)),
+ ("created_at", models.DateTimeField(auto_now_add=True)),
+ (
+ "identity_provider_config",
+ models.ForeignKey(
+ blank=True,
+ db_index=False,
+ null=True,
+ on_delete=django.db.models.deletion.SET_NULL,
+ related_name="scim_provisioned_users",
+ to="posthog.identityproviderconfig",
+ ),
+ ),
+ (
+ "organization_domain",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="scim_provisioned_users",
+ to="posthog.organizationdomain",
+ ),
+ ),
+ (
+ "user",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="scim_provisions",
+ to=settings.AUTH_USER_MODEL,
+ ),
+ ),
+ ],
+ options={
+ "db_table": "ee_scimprovisioneduser",
+ "indexes": [
+ models.Index(
+ fields=["organization_domain", "username"],
+ name="ee_scimprov_organiz_6d83ff_idx",
+ ),
+ models.Index(
+ fields=["identity_provider_config", "username"],
+ name="ee_scimprov_identit_3a28d7_idx",
+ ),
+ ],
+ "constraints": [
+ models.UniqueConstraint(
+ fields=("user", "organization_domain"),
+ name="unique_user_organization_domain",
+ ),
+ models.UniqueConstraint(
+ fields=("user", "identity_provider_config"),
+ name="unique_user_identity_provider_config",
+ ),
+ ],
+ },
+ ),
+ migrations.CreateModel(
+ name="SCIMRequestLog",
+ fields=[
+ (
+ "id",
+ models.UUIDField(
+ default=posthog.uuidt.uuid7,
+ editable=False,
+ primary_key=True,
+ serialize=False,
+ ),
+ ),
+ ("request_method", models.CharField(max_length=10)),
+ ("request_path", models.CharField(max_length=512)),
+ ("request_headers", models.JSONField(default=dict)),
+ ("request_body", models.JSONField(blank=True, null=True)),
+ ("response_status", models.SmallIntegerField()),
+ ("response_body", models.JSONField(blank=True, null=True)),
+ ("identity_provider", models.CharField(max_length=20)),
+ ("duration_ms", models.IntegerField(blank=True, null=True)),
+ ("created_at", models.DateTimeField(auto_now_add=True)),
+ (
+ "identity_provider_config",
+ models.ForeignKey(
+ blank=True,
+ db_index=False,
+ null=True,
+ on_delete=django.db.models.deletion.SET_NULL,
+ related_name="scim_request_logs",
+ to="posthog.identityproviderconfig",
+ ),
+ ),
+ (
+ "organization_domain",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="scim_request_logs",
+ to="posthog.organizationdomain",
+ ),
+ ),
+ ],
+ options={
+ "db_table": "ee_scimrequestlog",
+ "ordering": ["-created_at", "-id"],
+ "indexes": [
+ models.Index(
+ fields=["organization_domain", "-created_at"],
+ name="ee_scimrequ_organiz_3d32e0_idx",
+ ),
+ models.Index(
+ fields=["identity_provider_config", "-created_at"],
+ name="ee_scimrequ_identit_975d6d_idx",
+ ),
+ ],
+ },
+ ),
+ ],
+ ),
+ migrations.RunPython(update_content_types, reverse_content_types),
+ ]
diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txt
index a15841f66090..bf44342621e4 100644
--- a/posthog/migrations/max_migration.txt
+++ b/posthog/migrations/max_migration.txt
@@ -1 +1 @@
-1406_file_system_team_text_trgm_index
+1407_scimprovisioneduser_scimrequestlog
diff --git a/posthog/models/__init__.py b/posthog/models/__init__.py
index ae1fdb51545d..20586678410f 100644
--- a/posthog/models/__init__.py
+++ b/posthog/models/__init__.py
@@ -61,6 +61,8 @@ from .quick_filter import QuickFilter
from .remote_config import RemoteConfig
from .resource_transfer.resource_transfer import ResourceTransfer
from products.event_definitions.backend.models import EventSchema, SchemaPropertyGroup, SchemaPropertyGroupProperty
+from .scim_provisioned_user import SCIMProvisionedUser
+from .scim_request_log import SCIMRequestLog
from .share_password import SharePassword
from .sharing_configuration import SharingConfiguration
from .tag import Tag
@@ -160,6 +162,8 @@ __all__ = [
"EventSchema",
"SchemaPropertyGroup",
"SchemaPropertyGroupProperty",
+ "SCIMProvisionedUser",
+ "SCIMRequestLog",
"SessionRecording",
"SessionRecordingPlaylist",
"SessionRecordingExternalReference",
diff --git a/ee/models/scim_provisioned_user.py b/posthog/models/scim_provisioned_user.py
similarity index 99%
rename from ee/models/scim_provisioned_user.py
rename to posthog/models/scim_provisioned_user.py
index 0e1986a518a7..cb327090463b 100644
--- a/ee/models/scim_provisioned_user.py
+++ b/posthog/models/scim_provisioned_user.py
@@ -123,6 +123,7 @@ class SCIMProvisionedUser(UUIDModel, UpdatedMetaFields):
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
+ db_table = "ee_scimprovisioneduser"
constraints = [
models.UniqueConstraint(
fields=["user", "organization_domain"],
diff --git a/ee/models/scim_request_log.py b/posthog/models/scim_request_log.py
similarity index 98%
rename from ee/models/scim_request_log.py
rename to posthog/models/scim_request_log.py
index e06c8b20c171..d9376d10a36e 100644
--- a/ee/models/scim_request_log.py
+++ b/posthog/models/scim_request_log.py
@@ -44,6 +44,7 @@ class SCIMRequestLog(UUIDModel):
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
+ db_table = "ee_scimrequestlog"
indexes = [
models.Index(fields=["organization_domain", "-created_at"]),
models.Index(fields=["identity_provider_config", "-created_at"]),
diff --git a/posthog/settings/__init__.py b/posthog/settings/__init__.py
index b7a2beae0c86..d1653923f7a4 100644
--- a/posthog/settings/__init__.py
+++ b/posthog/settings/__init__.py
@@ -77,6 +77,20 @@ INSTANCE_PREFERENCES = {
}
SITE_URL: str = os.getenv("SITE_URL", "http://localhost:8010").rstrip("/")
+# django-scim2 requires these service-provider settings.
+SCIM_SERVICE_PROVIDER = {
+ "NETLOC": SITE_URL.replace("http://", "").replace("https://", ""),
+ "AUTHENTICATION_SCHEMES": [
+ {
+ "type": "oauthbearertoken",
+ "name": "OAuth Bearer Token",
+ "description": "Authentication scheme using the OAuth Bearer Token Standard",
+ "specUri": "https://www.rfc-editor.org/rfc/rfc6750.txt",
+ "documentationUri": "https://posthog.com/docs/settings/scim",
+ }
+ ],
+ "GROUP_MODEL": "products.access_control.backend.models.role.Role",
+}
NGROK_URL: str | None = os.getenv("NGROK_URL", None)
INSTANCE_TAG: str = os.getenv("INSTANCE_TAG", "none")
diff --git a/posthog/tasks/scheduled.py b/posthog/tasks/scheduled.py
index d4cbf2a905cc..ce357e1508bf 100644
--- a/posthog/tasks/scheduled.py
+++ b/posthog/tasks/scheduled.py
@@ -997,7 +997,7 @@ def setup_periodic_tasks(sender: Celery, **kwargs: Any) -> None:
name="delete expired delegation invites",
)
- from ee.tasks.scim_request_log_cleanup import cleanup_old_scim_request_logs
+ from posthog.tasks.scim_request_log_cleanup import cleanup_old_scim_request_logs
add_periodic_task_with_expiry(
sender,
diff --git a/ee/tasks/scim_request_log_cleanup.py b/posthog/tasks/scim_request_log_cleanup.py
similarity index 87%
rename from ee/tasks/scim_request_log_cleanup.py
rename to posthog/tasks/scim_request_log_cleanup.py
index a16121344809..82cff855b16b 100644
--- a/ee/tasks/scim_request_log_cleanup.py
+++ b/posthog/tasks/scim_request_log_cleanup.py
@@ -4,10 +4,9 @@ from django.utils import timezone
from celery import shared_task
+from posthog.models.scim_request_log import SCIM_REQUEST_LOG_RETENTION_DAYS, SCIMRequestLog
from posthog.scoping_audit import skip_team_scope_audit
-from ee.models.scim_request_log import SCIM_REQUEST_LOG_RETENTION_DAYS, SCIMRequestLog
-
CLEANUP_BATCH_SIZE = 1000
diff --git a/posthog/tasks/test/__snapshots__/test_task_registration.ambr b/posthog/tasks/test/__snapshots__/test_task_registration.ambr
index 1264cd8737cc..f248f0bbb503 100644
--- a/posthog/tasks/test/__snapshots__/test_task_registration.ambr
+++ b/posthog/tasks/test/__snapshots__/test_task_registration.ambr
@@ -108,6 +108,7 @@
'posthog.tasks.remote_config.refresh_expiring_remote_config_cache_entries',
'posthog.tasks.remote_config.sync_all_remote_configs',
'posthog.tasks.remote_config.update_team_remote_config',
+ 'posthog.tasks.scim_request_log_cleanup.cleanup_old_scim_request_logs',
'posthog.tasks.split_person.split_person',
'posthog.tasks.surveys.sync_all_surveys_cache',
'posthog.tasks.surveys.update_team_surveys_cache',
diff --git a/posthog/test/repo_invariants/setup_receivers_baseline.txt b/posthog/test/repo_invariants/setup_receivers_baseline.txt
index a1556ace9ef5..1b942bb09921 100644
--- a/posthog/test/repo_invariants/setup_receivers_baseline.txt
+++ b/posthog/test/repo_invariants/setup_receivers_baseline.txt
@@ -269,7 +269,7 @@ post_save:products.workflows.backend.models.hog_flow.hog_flow.hog_flow_saved
post_save:products.workflows.backend.models.hog_flow.hog_flow.team_saved_for_hog_flows
post_save:products.workflows.backend.models.hog_flow_batch_job.hog_flow_batch_job.handle_hog_flow_batch_job_created
post_save:products.workflows.backend.receivers.workflow_saved
-pre_delete:ee.models.scim_provisioned_user.clear_scim_provisioned_user_config
+pre_delete:posthog.models.scim_provisioned_user.clear_scim_provisioned_user_config
pre_delete:posthog.models.activity_logging.signal_handlers.handle_experiment_holdout_delete
pre_delete:posthog.models.activity_logging.signal_handlers.handle_experiment_saved_metric_delete
pre_delete:posthog.models.activity_logging.signal_handlers.handle_personal_api_key_delete
diff --git a/posthog/test/test_scim_content_type_migration.py b/posthog/test/test_scim_content_type_migration.py
new file mode 100644
index 000000000000..fcef08ee0cf0
--- /dev/null
+++ b/posthog/test/test_scim_content_type_migration.py
@@ -0,0 +1,38 @@
+from importlib import import_module
+from types import SimpleNamespace
+
+from django.apps import apps
+from django.contrib.auth.models import (
+ Group as AuthGroup,
+ Permission,
+)
+from django.contrib.contenttypes.models import ContentType
+from django.db import connection
+from django.test import TestCase
+
+from parameterized import parameterized
+
+from posthog.models import User
+
+scim_migration = import_module("posthog.migrations.1407_scimprovisioneduser_scimrequestlog")
+
+
+class TestSCIMContentTypeMigration(TestCase):
+ @parameterized.expand(["scimprovisioneduser", "scimrequestlog"])
+ def test_duplicate_permissions_merge_grants(self, model_name: str) -> None:
+ source, _ = ContentType.objects.get_or_create(app_label="ee", model=model_name)
+ target, _ = ContentType.objects.get_or_create(app_label="posthog", model=model_name)
+ codename = f"scim_migration_test_{model_name}"
+ source_permission = Permission.objects.create(content_type=source, codename=codename, name="Source permission")
+ target_permission = Permission.objects.create(content_type=target, codename=codename, name="Target permission")
+ user = User.objects.create_user(email=f"{model_name}@example.com", password=None, first_name="SCIM")
+ group = AuthGroup.objects.create(name=f"scim-migration-{model_name}")
+ user.user_permissions.add(source_permission)
+ group.permissions.add(target_permission)
+
+ scim_migration.update_content_types(apps, SimpleNamespace(connection=connection))
+
+ self.assertFalse(ContentType.objects.filter(pk=source.pk).exists())
+ self.assertEqual(Permission.objects.filter(content_type=target, codename=codename).count(), 1)
+ self.assertTrue(user.user_permissions.filter(content_type=target, codename=codename).exists())
+ self.assertTrue(group.permissions.filter(content_type=target, codename=codename).exists())
diff --git a/posthog/urls.py b/posthog/urls.py
index 06dbc2658e4e..b80c0eaebd54 100644
--- a/posthog/urls.py
+++ b/posthog/urls.py
@@ -27,6 +27,7 @@ from posthog.api.integration_connect import integration_connect_redirect
from posthog.api.livestream import LivestreamAuthorizationView
from posthog.api.oauth.connected_apps import ConnectedAppsViewSet
from posthog.api.oauth.toolbar_views import authorize_and_redirect
+from posthog.api.scim import views as scim_views
from posthog.api.sdk_health import sdk_health
from posthog.api.two_factor_qrcode import CacheAwareQRGeneratorView
from posthog.api.web_experiment import web_experiments
@@ -136,6 +137,29 @@ urlpatterns = [
opt_slash_path("_preflight", preflight_check),
# ee
*ee_urlpatterns,
+ path("scim/v2/<str:scim_slug>/Users", csrf_exempt(scim_views.SCIMUsersView.as_view()), name="scim_users"),
+ path(
+ "scim/v2/<str:scim_slug>/Users/<int:user_id>",
+ csrf_exempt(scim_views.SCIMUserDetailView.as_view()),
+ name="scim_user_detail",
+ ),
+ path("scim/v2/<str:scim_slug>/Groups", csrf_exempt(scim_views.SCIMGroupsView.as_view()), name="scim_groups"),
+ path(
+ "scim/v2/<str:scim_slug>/Groups/<uuid:group_id>",
+ csrf_exempt(scim_views.SCIMGroupDetailView.as_view()),
+ name="scim_group_detail",
+ ),
+ path(
+ "scim/v2/<str:scim_slug>/ServiceProviderConfig",
+ csrf_exempt(scim_views.SCIMServiceProviderConfigView.as_view()),
+ name="scim_service_provider_config",
+ ),
+ path(
+ "scim/v2/<str:scim_slug>/ResourceTypes",
+ csrf_exempt(scim_views.SCIMResourceTypesView.as_view()),
+ name="scim_resource_types",
+ ),
+ path("scim/v2/<str:scim_slug>/Schemas", csrf_exempt(scim_views.SCIMSchemasView.as_view()), name="scim_schemas"),
# api
path("api/unsubscribe", unsubscribe.unsubscribe),
path("api/alerts/github", github.SecretAlert.as_view()),