matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

Unable to register user

Open KathurimaKimathi opened this issue 2 years ago • 5 comments

I have deployed the matrix synapse server following the steps highlighted here.

I want to register a new client using this endpoint /_matrix/client/v3/register with this payload: { "auth": { "type": "m.login.password", "identifier": { "type": "m.id.user", "user": "myuser" }, "password": "myuserpass" }, "initial_device_display_name": "Maiyo", "password": "newuser", "username": "newuserpass" } However, on POSTing the data, I am getting a 401 status code with this response: { "session": "BxwLHLGuvEsYEwphxQvHUVxx", "flows": [ { "stages": [ "m.login.registration_token", "m.login.dummy" ] }, { "stages": [ "m.login.registration_token", "m.login.email.identity" ] } ], "params": {}, "completed": [ "m.login.password" ] }

Is there anything I am expected to do or what could I be missing?

KathurimaKimathi avatar Feb 27 '23 07:02 KathurimaKimathi

Sounds like your server does not enabled public registration (which is the default configuration setting).

spantaleev avatar Feb 27 '23 07:02 spantaleev

I have enabled that by setting matrix_synapse_enable_registration to true and matrix_synapse_enable_registration_without_verification to false for matrix_synapse

KathurimaKimathi avatar Feb 27 '23 08:02 KathurimaKimathi

Having very similar issue with a brand new instance set up few days ago... My host_vars (lifted from registration bot document)

matrix_bot_matrix_registration_bot_enabled: true
matrix_bot_matrix_registration_bot_container_image_self_build: true
matrix_bot_matrix_registration_bot_docker_repo_version: main
# Generate a strong password here. Consider generating it with `pwgen -s 64 1`
matrix_bot_matrix_registration_bot_bot_password: foobar

# Enables registration
matrix_synapse_enable_registration: true
# Restrict registration to users with a token
matrix_synapse_registration_requires_token: true

Register API request:

{
  "username": "foo",
  "password": "bar",
  "initial_device_display_name": "foobar",
  "auth": {
    "session": "foo",
    "type": "m.login.registration_token",
    "token": "bar"
  }
}

401 response (after providing the token):

{
  "session": "foo",
  "flows": [
    {
      "stages": [
        "m.login.registration_token",
        "m.login.dummy"
      ]
    },
    {
      "stages": [
        "m.login.registration_token",
        "m.login.email.identity"
      ]
    }
  ],
  "params": {},
  "completed": [
    "m.login.registration_token"
  ]
}

The token was consumed but registration page was stuck at the throbber.

GitHubGeek avatar Jan 04 '24 10:01 GitHubGeek

Further testing shows that token + dummy flow works by not supplying an email during create account. However, token + email.identity flow failed.

GitHubGeek avatar Jan 04 '24 11:01 GitHubGeek

I have a similar issue - if the user provides email upon registration - the request fails with 401, but if not - then all is good.

nycterent avatar Feb 07 '24 21:02 nycterent