matrix-org / matrix-org/matrix-python-sdk

Support using "User-Interactive Authentication API" for login/register

Open
#82 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Api layer architecture breaking Client layer enhancement
Dominant language
Python
Stars
266
Forks
118
PR merge metrics
No merged PRs in 30d

Description

Hi,

First of all, thanks for the SDK, that helps a lot!

Now onto my issue: I followed MatrixClient's example on registering an user and got back an error about captcha. Could this be a change in Matrix' protocol that wasn't propagated down here?

>>> from matrix_client.client import MatrixClient
>>> client = MatrixClient("https://matrix.org")
>>> token = client.register_with_password(username="foobar1234", password="password")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dryvenn/Downloads/matrix-python-sdk/matrix_client/client.py", line 126, in register_with_password
    "m.login.password", user=username, password=password
  File "/Users/dryvenn/Downloads/matrix-python-sdk/matrix_client/api.py", line 110, in register
    return self._send("POST", "/register", content)
  File "/Users/dryvenn/Downloads/matrix-python-sdk/matrix_client/api.py", line 459, in _send
    code=response.status_code, content=response.text
matrix_client.errors.MatrixRequestError: 400: {"errcode":"M_UNKNOWN","error":"Captcha is required."}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with matrix_client/client.py at MatrixClient.register_with_password and follow the call into matrix_client/api.py's register and _send methods. Reproduce the shown registration request against matrix.org and inspect the User-Interactive Authentication API requirements. Done means login and registration support that API rather than failing with the captcha-required response.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, authentication
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.