Package: openslides-saml
OverviewThis plugin for OpenSlides provides a login via a SAML single sign on
service.RequirementsOpenSlides 2.2|2.3python3-saml (>= 1.3.0)Note: python3-saml needs thy python packagexmlsecwhich depends onlibxml2. Those packages need to be installed on a Debian-like system:$ apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl pkg-configFor more information about other operating systems or distributions visithttp://pythonhosted.org/xmlsec/install.html.InstallThis is only an example instruction to install the plugin on GNU/Linux. It
can also be installed as any other python package and on other platforms,
e. g. on Windows.Change to a new directory:$ cd
$ mkdir OpenSlides
$ cd OpenSlidesSetup and activate a virtual environment and install OpenSlides and the
plugin in it:$ python -m venv .venv
$ source .venv/bin/activate
$ pip install openslides-samlStart OpenSlides:$ openslidesConfigurationBefore the first start this line needs to be added to thesettings.py:SETTINGS_FILEPATH = __file__If this line isn’t there, the plugin will remind you :).On startup of OpenSlides thesaml_settings.jsonis created in the settings folder if
it does not exist. To force creating this file run:$ python manage.py create-saml-settings [--dir /<path to custom settings dir>/]The path has to match with the settings path OpenSlides is started with.For the first part in the settings file refer topython3-saml settings documentation. All settings described there are
merged into thesaml_settings.json. Also note theREADMEfile in thecertsfolder next to thesaml_settings.json.General SettingsHere you can provide a custom text for the SAML login button. ThechangePasswordUrlredirects the user to the given URL when click onChange passwordin the OpenSlides user
menu.AttributesThe identity provider sends attributes to the plugin if a user sucessfully logged in. To
map these attributes to attributes of OpenSlides users, the sectionattributeMappingexists. The structure is like this:"attributeMapping: {
    "attributeFromIDP": ["attributeOpenSlidesUser", <used for lookup>],
    "anotherAttributeFromIDP": ["anotherAttributeOpenSlidesUser", <used for lookup>]
}All available OpenSlides user attributes are:username: Has to be unique. Identifies the user.first_name: The user’s first name.last_name: The user’s last name.title: The title of the user, e.g. “Dr.”.email: The user’s email addreess.structure_level: The structure level.number: The participant number. This field is not unique.about_me: A free text field.is_active,is_present,is_committee: Boolean flags.To get detailed information see themodels.py.The<used for lookup>has either to betrueorfalse. All attributes with this
value being true are used to search for an existing user. If the user is found, the user gets
updated with all changed values and used to log in. If the user is not found, it will be
created with all values given. Try to choose unique attributes (e.g. the username),
attributes you are sure about to be unique (e.g. maybe the number) or use a combination of
attributes.RequestsThe metadata and requests are prepared for saml, e.g. the port number is needed. If not specified all these values are taken from the requests meta information:https: Eitheronoroff.http_host: The hostname.script_name: The aquivalent toPATH_INFOin the meta values.server_port: The port listen by the server.These values may be false, because OpenSlides runs on port 8000 behind a webserver
redirecting the traffic from port 80 to port 8000. In the sectionrequestSettingsyou
can set these values to overwrite the values get in the meta information.DevelopmentTo contribute to this plugin please create your own fork and work there in a branch
different tomaster. Clone your fork, create a virtual environment and make a link
into a development checkout from OpenSlides (refer tothis guide):$ ln -s /<path to this plugin>/openslides_saml /<path to os>/You just need to add'openslides_saml'to yoursettings.pyto enable this plugin.For codestyle currentlyflake8andisortare checking the code. To install them
run apip install-rrequirements.txt. Feel free to add unit or integration testing.Happy contribution :)License and authorsThis plugin is Free/Libre Open Source Software and distributed under the
MIT License, see LICENSE file. The authors are mentioned in the AUTHORS file.ChangelogVersion 1.0.1 (2018-10-19)Support for OpenSlides 2.3Version 1.0 (2018-06-22)Initial release. Please read the README for every setting and
possibility for customization.Support for OpenSlides 2.2