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 touidto identify the remote user instead of theNameIDfrom the assertion.Trueby 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_fileallowing the list of bad domains to be specified inline in the config.If both
bad_domain_fileandbad_domain_listare 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
Metadata
Release files for matrix-synapse-saml-mozilla 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| matrix-synapse-saml-mozilla-0.2.6.tar.gz | 25.1 kB | Without provenance | Details for matrix-synapse-saml-mozilla-0.2.6.tar.gz |
Release files / matrix-synapse-saml-mozilla-0.2.6.tar.gz
| Download URL | matrix-synapse-saml-mozilla-0.2.6.tar.gz |
|---|---|
| Size | 25.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
864b021e0a68b25c13d29f2c9567301b46f6eac2acd8a2af3650234fd85f089c
|
|
BLAKE2b-256 checksum How to use checksums |
87654c04d3ddc80d460e6af3c75963c5f383db8b517cd22abd0e950d698230fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3
|
Security for matrix-synapse-saml-mozilla 0.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.