SCIM 2.0 Client Library
raw JSON → 0.7.5 verified Sat May 09 auth: no python
Python library for building SCIM 2.0 requests and parsing SCIM responses. Provides client and filter models to interact with SCIM servers. Current version 0.7.5, requires Python >=3.10. Maintained by the scim2-client authors.
pip install scim2-client Common errors
error ModuleNotFoundError: No module named 'scim2_filter' ↓
cause Missing scim2-filter package.
fix
Install scim2-filter: pip install scim2-filter
error ValueError: 'auth' must be a tuple of (username, password) ↓
cause auth parameter provided as a string instead of tuple.
fix
Change auth=('username', 'password')
Warnings
gotcha The 'Filter' class is not part of 'scim2-client' but from the separate 'scim2-filter' package. You must install it separately: 'pip install scim2-filter'. ↓
fix Install scim2-filter and import from 'scim2_filter'.
breaking Version 0.7.0 dropped support for Python 3.7 and 3.8. If upgrading from an older version, ensure your environment uses Python >=3.10. ↓
fix Update to Python >=3.10.
gotcha The 'auth' parameter expects a tuple (username, password) for HTTP Basic Auth. Using a single string will raise an error. ↓
fix Pass auth as a tuple: auth=('user', 'pass')
Imports
- SCIMClient wrong
from scim2 import SCIMClientcorrectfrom scim2_client import SCIMClient - Filter wrong
from scim2_client import Filtercorrectfrom scim2_filter import Filter
Quickstart
from scim2_client import SCIMClient
from scim2_filter import Filter
client = SCIMClient(
base_url=os.environ.get('SCIM_BASE_URL', 'https://example.com/scim/v2'),
auth=('user', os.environ.get('SCIM_PASSWORD', ''))
)
# List users with a filter
filter_ = Filter.eq('userName', 'jdoe')
response = client.Users.list(filter=filter_)
print(response.resources)