An Mozilla-flavoured SAML MXID mapper for Synapse
Project description
Synapse Mozilla SAML MXID Mapper
A Synapse plugin module which allows users to choose their username when they first log in.
Installation
This plugin can be installed via PyPi:
pip install matrix-synapse-saml-mozilla
Config
Add the following in your Synapse config:
saml2_config:
user_mapping_provider:
module: "matrix_synapse_saml_mozilla.SamlMappingProvider"
Also, under the HTTP client listener
, configure an additional_resource
as per
the below:
listeners:
- port: <port>
type: http
resources:
- names: [client]
additional_resources:
"/_matrix/saml2/pick_username":
module: "matrix_synapse_saml_mozilla.pick_username_resource"
Configuration Options
Synapse allows SAML mapping providers to specify custom configuration through the
saml2_config.user_mapping_provider.config
option.
Currently the following options are supported:
-
use_name_id_for_remote_uid
: if set toFalse
, we will use the SAML attribute mapped touid
to identify the remote user instead of theNameID
from the assertion.True
by default. -
bad_domain_file
: should point a file containing a list of domains (one per line); users who have an email address on any of these domains will be blocked from registration. -
bad_domain_list
: an alternative tobad_domain_file
allowing the list of bad domains to be specified inline in the config.If both
bad_domain_file
andbad_domain_list
are specified, the two lists are merged.
Implementation notes
The login flow looks something like this:
Development and Testing
This repository uses tox
to run linting and tests.
Linting
Code is linted with the flake8
tool. Run tox -e lint
to check for linting
errors in the codebase.
Tests
This repository uses unittest
to run the tests located in the tests
directory. They can be ran with tox -e tests
.
Making a release
git tag vX.Y
python3 setup.py sdist
twine upload dist/matrix-synapse-saml-mozilla-X.Y.tar.gz
git push origin vX.Y
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file matrix-synapse-saml-mozilla-0.2.tar.gz
.
File metadata
- Download URL: matrix-synapse-saml-mozilla-0.2.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17cde0db04ec5482f1e329bbe93d37390aa536a15286865c40865cc96776422c |
|
MD5 | 6c393560d5e9ca42e5476b652c7e68b5 |
|
BLAKE2b-256 | 4a3e1ff4d8601ec11b29a7209d018a156fb24833e992bd1e94fa8ab9c9b830de |