Serve a SCIM 2.0 server from a Django project, as RFC7643 and RFC7644 define it. It is built upon scim2-server and scim2-models. It stores the resources in the models of your project.
- Storage in the models of your project, with filters, sorts and pages run in the database, on SQLite, PostgreSQL and MariaDB
manage.py checkchecks the mappings between SCIM attributes and model fields- The users and the groups of
django.contrib.authserved without any table, and a model beside them forexternalId,meta.lastModifiedand the attributes of your project - Resource endpoints:
POST,GET,PUT,PATCHandDELETE, for every resource type - Search:
GETandPOST /.search, per resource type and at the server root - Discovery endpoints:
/ServiceProviderConfig,/ResourceTypesand/Schemas - Bulk operations:
POST /Bulk, withbulkIdreferences,failOnErrors,maxOperationsandmaxPayloadSize /Me, once your project tells which resource belongs to the authenticated client- Conditional requests with ETags:
If-MatchandIf-None-Match - SCIM error payloads for every failure
- Several SCIM servers in one project, each with its own URL namespace
# urls.py
from django.urls import path
from scim2_models import ResourceType, ScimProvider, User
from scim2_django import ScimSite
from scim2_django.storage import DjangoStorage, ResourceMapping
from accounts.models import Account
USERS = ResourceMapping(
User,
Account,
{
"id": "id",
"userName": "login",
"meta.created": "created_at",
"meta.lastModified": "updated_at",
},
version="revision",
)
def authenticate(request): ...
provider = ScimProvider.from_discovery(
USERS.schemas(), [ResourceType.from_resource(User)]
)
storage = DjangoStorage({"User": USERS}, provider)
site = ScimSite(storage, provider, authenticate=authenticate)
urlpatterns = [
path("scim/v2/", site.urls),
]pip install scim2-django- Overview builds a SCIM server over the models of an existing project.
- How-to guides cover authentication, URLs, reverse proxies, request sizes and transactions.
- Reference lists the public API and the system checks.
SCIM stands for System for Cross-domain Identity Management, and it is a provisioning protocol. Provisioning is the action of managing a set of resources across different services, usually users and groups. SCIM is often used between Identity Providers and applications, alongside standards like OAuth2 and OpenID Connect. It synchronizes the creation, modification and deletion of users and groups between applications.
Questions and bug reports go to the issue tracker.
The contribution page describes how to run the tests, the style checks and the documentation build.
scim2-django is released under the Apache-2.0 license.
scim2-django belongs in a collection of SCIM tools developed by Yaal Coop, with scim2-models, scim2-client, scim2-server, scim2-tester and scim2-cli.