scim2-sqlalchemy#
scim2-sqlalchemy stores SCIM resources in the tables of an application, with the SQLAlchemy ORM. A mapping declares which column holds each SCIM attribute. A storage then reads, writes, filters, sorts and pages the resources for scim2-server, which serves the SCIM protocol of RFC 7643 and RFC 7644.
This documentation is for Python developers who add a SCIM server to an application whose data lives in SQLAlchemy models. It assumes familiarity with SQLAlchemy 2.0. The protocol, the web frameworks and the authentication are described in the scim2-server documentation.
users = ResourceMapping(
User,
Account,
{
"id": Account.id,
"userName": Account.login,
"name.givenName": Account.first_name,
"emails": Many(Account.emails, {"value": EmailAddress.address}),
"meta.created": Account.created_at,
"meta.lastModified": Account.updated_at,
},
version=Account.revision,
)
storage = SqlAlchemyStorage({"User": users}, lambda: session)
$ pip install scim2-sqlalchemy
Choose a path#
Start with the page that matches the need:
To build a SCIM server over the tables of an existing application, follow the Overview.
To build a SCIM server without tables of its own, generate them from the resource types: read Generate the tables.
To map other data models, publish the stored attributes, commit the changes of each request, or compare strings with a custom comparison key, read the how-to guides.
For the reasons behind the behavior of the storage, read How the storage works.
For the public API, the supported searches and the errors, read the reference.