pleio-profile-sync-client

A Python client that can be used to automatically sync profile information from an identity store to a Pleio subsite.


Keywords
active directory, authorization, csv
License
EUPL-1.2
Install
pip install pleio-profile-sync-client==0.2.0

Documentation

Profile sync client

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.

How does it work?

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.

Features

  • Automatically creating, updating and blocking users from a subsite
  • Ability to sync profile fields and site-specific avatars
  • Test the synchronization with the dry-run option
  • Remote log inspection by uploading the logs to the REST API

Requirements

The package requires a Python version >= 3.3.

Installation

Installation (and updates) are done with a single command:

pip3 install pleio-profile-sync-client

Usage

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:

  • external_id, attribute to link local users with users on the subsite (optional)
  • name, the full name of the user
  • email, the e-mailaddress of the user
  • avatar, a relative link to the avatar in jpeg of the user
  • profile.*, a field containing profile information, for example: 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.