spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.88k stars 1.04k forks source link

Registration with 3pid: phone / msisdn #598

Open T3chTobi opened 4 years ago

T3chTobi commented 4 years ago

Thank you for this amazing playbook!

I wanted to ask how I could make the phone number (msisdn) required at the registration?

  1. I added this to the my custom vars.yml:

    matrix_synapse_registrations_require_3pid:
    - email
    - msisdn
  2. After running ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start I get following error when I try to register as a new user:

    {
     "errcode":"M_NOT_IMPLEMENTED",
     "error":"msisdn is not a supported 3PID medium type",
     "success":false
    }
  3. I found the option matrix_synapse_account_threepid_delegates_msisdn. Is this the reason the registration failed? How do I create an identity server? I have an API access to Twilio and knowledge in PHP. I could create an URL that receives the parameters from synapse, send the SMS with a token. Is this what is required?

Could you please provide an example of how to use this parameter und how to create a working identity server? Any help is appreciated!

ctwelve commented 4 years ago

Hi! You need to enable MSISDN integration with Twilio, which is a problem I ran into previously and documented. It's super cheap but if you don't do it, it won't let you use MSISDNs. Which makes sense, really.

ctwelve commented 4 years ago

Specifically, see this: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-ma1sd.md#example-sms-verification

T3chTobi commented 4 years ago

Thank you for your answer @ctwelve! Is there a way to set it up with my custom build SMS sending service alternativ to Twilio? I don't like giving all the phone numbers to an external service like Twilio

ctwelve commented 4 years ago

Not that I know of, no. There is an SMS bridge but it requires hardware access to a phone. And, honestly, access to the PSTN is gatekeeper'd pretty heavily, by design and frankly good sense. Twilio is the cheapest way to do it I've seen. For my volume, it's basically a dollar a month.

ctwelve commented 4 years ago

It should also be noted that Twilio is not merely emailing out SMS via email gateways. They're transmitting real SMS/MMS/EMS directly on the phone network, and can do things like identity verification and the like. Sending via Twilio is a much, much stronger assertion that the message is genuinely going to the endpoint number you specify.