Skip to main content

SAML mapping provider to strip hostnames from mxids

Project description

This mapping provider strips the part from UIDs coming from a SAML2 identity provider (IDP). This is useful for example when using Google Apps as an IDP, to avoid getting Matrix IDs like (instead you’ll get

Note: At the time of this writing, the support for user-configurable mapping providers hasn’t been released yet. You will probably have to wait for Synapse 1.7 or 1.8, or install an unreleased version of Synapse.


Run the following command in the same virtual environment of your Synapse install:

pip install matrix-saml-strip-hostname

Then edit the homeserver.yaml file on your Synapse install to use the new mapping provider:

    module: matrix_saml_strip_hostname.mapping_providers.StripHostnameSamlMappingProvider


This mapper inherits from the default mapping provider. It will first strip the hostname, and then pass the result to the synapse.handlers.saml_handler.DefaultSamlMappingProvider mapping provider. There is no support for disabling this post-processing.

Refer to the default configuration file for configuration options for the default provider.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for matrix-saml-strip-hostname, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size matrix_saml_strip_hostname-0.1.3-py3-none-any.whl (2.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size matrix-saml-strip-hostname-0.1.3.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page