A Python client that can be used to automatically sync profile information from an identity store to a Pleio subsite.
pip install pleio-profile-sync-client==0.2.0
The profile sync client automatically synchronises users from a local identity store to a Pleio subsite. The client is built in Python and uses a REST/JSON API to connect to Pleio.
The client is installed on a server that is maintained by the subsite holder. The client reads a local file (CSV) that contains a list users. It synchronises the state of the Pleio subsite with the local file. Users that are not on the site are added, the profile of existing users is updated and users not on the list are optionally banned.
The client uses two attributes to link local users with users on the subsite: external_id and email.
The profile sync client can be used together with Single Sign On (SSO) through SAML2. The SSO flow and the creation of a Pleio user is managed by account.pleio.nl. The authorisation of the Pleio user on the subsite is handled by the profile sync client.
The profile sync client outputs logs to standard output, but also writes the logs to the REST API. The logs can be inspected by the subsite administrator.
The package requires a Python version >= 3.3.
Installation (and updates) are done with a single command:
pip3 install pleio-profile-sync-client
Use the CLI tool as follows:
$ pleio-profile-sync-client --api-secret {secret} --source example/users.csv --destination https://{subsite}.pleio.nl/profile_sync_api/
The CSV accepts the following fields:
profile.occupation
.Check example/users.csv for an example.
Please note the api-secret is stored in the processlist and in the shell history when running the command like this. For a more secure way of executing the command, check out example-script.sh.