Skip to content
a token based matrix registration api
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.coveragerc coverage omit __main__ May 13, 2018
LICENSE Create LICENSE May 14, 2018
requirements.txt update requirements Apr 15, 2019
tox.ini python 3.8 Apr 16, 2019

Build Status Coverage Status PyPI - Python Version PyPI Matrix Chat


a simple python application to have a token based matrix registration

if you like me encountered the situation where you want to invite your friends to your homeserver, but neither wanted to open up public registration nor create accounts for every individual user yourself, this project should be the solution.

with this project you can just quickly generate tokens on the fly and share them with your friends to allow them to register to your homeserver.


pip3 install matrix-registration
python3 -m matrix_registration


  • This only asks you for the most important options. You should definitely take a look at the actual configuration file.
  • The shared_secret has to be the same as registration_shared_secret in your homeserver.yaml

nginx reverse-proxy

an example nginx setup:

location  ~ ^/(static|register) {
        proxy_pass http://localhost:5000;

If you already have a website and want to use your own register page, the wiki describes a more advanced nginx setup.


$ python -m matrix_registration -h
usage: python -m matrix_registration [-h] {api,gen,status,config} ...

a token based matrix registration app

positional arguments:
                        sub-commands. for ex. 'gen -h' for additional help
    api                 start as api
    gen                 generate new token. -o onetime, -e expire date
    status              view status or disable token. -s status, -d disable,
                        -l list
    config              show config location

optional arguments:
  -h, --help            show this help message and exit

after you've started the api server and generated a token you can register an account with a simple post request, e.g.:

curl -X POST \
     -F 'username=test' \
     -F 'password=verysecure' \
     -F 'confirm=verysecure' \
     -F 'token=DoubleWizardSki' \

or by visiting http://localhost:5000/register?token=DoubleWizardSki


if you want to write your own registration page, you can take a look at the sample in resources/example.html

the html page looks for the query paramater token and sets the token input field to it's value. this would allow you to directly share links with the token included, e.g.: https://homeserver.tld/register.html?token=DoubleWizardSki

For more info check the wiki

You can’t perform that action at this time.