Skip to main content

A validator for System for Cross domain Identity Management (SCIM) responses given predefine schemas

Project description



Validate JSon content given a predefined set of SCIM Schemas (in JSON representation format) as specified in SCIM (supporting Python 3+).

Example use case

  1. Install the library via pip:
pip install scimschema
  1. Specify any custom schemas in json format as per the rfc requirement:
  2. Put the json files under a Python package as per our examples here: (also checkout our __init__() file which is handy for loading the json)
  3. Import the `validate` method from scimschema and pass in json response/request content and the extension schemas to assert its validness

To step through the above in working code, check out this test:

from scimschema import validate
from . import extension # <- this is the custom schemas define by your: see for example

# A sample schema, like what we'd get from response.get(<scim entity url>).json()
content = {
    "schemas": ["urn:ietf:params:scim:schemas:core2:2.0:Group", "urn:huddle:params:scim:schemas:extension:2.0:SimpleAccount"],
    "id": "2819c223-7f76-453a-919d-413861904646",
    "externalId": 9,
    "meta": {
        "resourceType": "User",
        "created": "2011-08-01T18:29:49.793Z",
        "lastModified": "Invalid date",
        "location": "",
        "version": "W\/\"f250dd84f0671c3\""

>>>    E   _scimschema._model.scim_exceptions.AggregatedScimMultValueAttributeValidationExceptions: Found 1 aggregated exceptions at Scim response:
>>>    E    ScimAttributeValueNotFoundException:
>>>    E             'Single-value attribute:ipRestrictionsEnabled' is required at the following location '['urn:huddle:params:scim:schemas:extension:2.0:Account', 'ipRestrictionsEnabled']' but found '{}'
>>>    !!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!


Support for SCIM 2.0,
  • Validate SCIM Schema definition
    • Validate Model (schema) Id, Name, description, attributes
    • Validate Attribute (schema) Name, Type, Required, Canonical Values, Mutability, Returned, Uniqueness
  • Validate JSON Content against SCIM Schema
    • Validate significant value against Type (Binary, Boolean, Datetime, Decimal, Integer, Reference, String, Complex, MultiValued)
    • Characteristics Required, Canonical Values, Uniqueness

Upcoming features

  • Validate JSON Content for characteristics below:
    • Mutability, Returned

Running the Test Suite

The project requires poetry The project requires pytest to discover tests, and it complies to PEP 517 via Poetry (see pyproject.toml) Github Actions are to run on commit as part of CI and automatic deployments.

Creating new release

Update scimschema/VERSION and pyproject.toml Merge into release branch


This project is powered by the QA department at Huddle

The source code is available on GitHub.

Get in touch, via GitHub or otherwise, contributors are also welcome!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for scimschema, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size scimschema-0.3.1-py3-none-any.whl (24.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size scimschema-0.3.1.tar.gz (18.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page