Pydantic SCIM

0.0.8 · active · verified Fri Apr 17

Pydantic-SCIM provides Pydantic models that strictly adhere to the SCIM (System for Cross-domain Identity Management) specification. It allows developers to define, validate, and serialize SCIM resources like Users and Groups, simplifying integration with SCIM-compliant identity providers. The library currently supports Pydantic v1.x.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to instantiate a SCIM User object and serialize it to JSON, following the required SCIM schema fields. Note the use of `user.json()` for Pydantic v1 serialization.

from pydantic_scim import User

# Create a SCIM User object adhering to the SCIM Core Schema
user = User(
    schemas=["urn:ietf:params:scim:schemas:core:2.0:User"],
    userName="bjensen",
    name={
        "givenName": "Barbara",
        "familyName": "Jensen"
    },
    emails=[
        {
            "value": "bjensen@example.com",
            "type": "work",
            "primary": True
        }
    ],
    active=True,
    externalId="employee-id-123"
)

# Serialize the user object to JSON (using Pydantic v1 .json() method)
print(user.json(indent=2))

view raw JSON →