Code Monkey home page Code Monkey logo

matrix-synapse-rest-password-provider's People

Contributors

devplayer0 avatar halkeye avatar ma1uta avatar maxidorius avatar peerd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

matrix-synapse-rest-password-provider's Issues

Convert provider from twisted deferreds to async

Someone mentioned in matrix-org/synapse#8108 that they used a very similar implementation of a password provider to the one in this repo, which has started raising exceptions come Synapse v1.19.0. This is due to Synapse phasing out Twisted defer calls, and instead switching to Python async/await (which brings increased performance and ability to profile the codebase).

@menturion updated the codebase according to their comment. The same will likely need to happen here for this provider to work properly with Synapse v1.19.0.

Users in auto-joined rooms have empty display name

New Synapse have auto_join feature, that automatically joins new users to needed rooms.

But the problem when using with matrix-synapse-rest-password-provider, that users, auto-joined to those rooms, have empty (equal login) display name, instead of configured via ma1sd display name (on my setup name is auto-filled from LDAP via ma1sd) in this room. In new rooms, in which users joined or invited manually, display name shows well. If user manually change (set again) his display name globally in settings, it updated successfully in all rooms.

Seems auto_join event happens before matrix-synapse-rest-password-provider set right display name to user? Can you lookup, is it possible to fix this issue in matrix-synapse-rest-password-provider module, or it need some changes in Synapse?

passphrase needs to be reentered for every relogin

I don't know if and how this issue is related to the rest_auth_provider, but after authenticating users on a clean, separated synapse install with a fresh database against a postgres db via a django rest api call, everything works as expected, except every user has to re-enter the passphrase after logging out and trying to re-login.

My guess is the device tokens or whatever are not considered correctly, but every advice into the right direction is welcomed.

TypeError: object DataStore can't be used in 'await' expression

I get the following error with Synapse 1.18.0:

2020-07-31 21:42:46,920 - synapse.http.server - 83 - ERROR - POST-825- Failed handle request via 'LoginRestServlet': <XForwardedForRequest at 0x7f51bedf96d0 method='POST' uri='/_matrix/client/r0/login' clientproto='HTTP/1.1' site=8008>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: {}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: {}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: @test:reucon.com

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/synapse/http/server.py", line 228, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/usr/local/lib/python3.7/site-packages/synapse/http/server.py", line 399, in _async_render
    callback_return = await raw_callback_return
  File "/usr/local/lib/python3.7/site-packages/synapse/rest/client/v1/login.py", line 169, in on_POST
    result = await self._do_other_login(login_submission)
  File "/usr/local/lib/python3.7/site-packages/synapse/rest/client/v1/login.py", line 287, in _do_other_login
    identifier["user"], login_submission
  File "/usr/local/lib/python3.7/site-packages/synapse/handlers/auth.py", line 723, in validate_login
    is_valid = await provider.check_password(qualified_user_id, password)
  File "/usr/local/lib/python3.7/site-packages/rest_auth_provider.py", line 85, in check_password
    store = await self.account_handler._hs.get_profile_handler().store  # for synapse >= 1.9.0
TypeError: object DataStore can't be used in 'await' expression

displayName no longer synced

This may have the same reason as in #5

Since Synapse version 1.19 (or later. Noticed in v 1.20) our displayNames are no longer set during login. I've downgraded to synapse v 1.18. That fixed the issue.

Here's a synapse log from v 1.18:
2020-10-02 14:48:00,209 - rest_auth_provider - 81 - INFO - POST-170 - Handling profile data
2020-10-02 14:48:00,209 - rest_auth_provider - 92 - INFO - POST-170 - Setting display name to 'Francsi, Jan Test Tmp (Testuser)' based on profile data
2020-10-02 14:48:00,213 - rest_auth_provider - 99 - INFO - POST-170 - Handling 3PIDs
2020-10-02 14:48:00,213 - rest_auth_provider - 106 - INFO - POST-170 - Looking for 3PID email:[email protected] in user profile
2020-10-02 14:48:00,213 - rest_auth_provider - 119 - INFO - POST-170 - 3PID is present, skipping
2020-10-02 14:48:00,214 - twisted - 192 - WARNING - - /usr/local/lib/python3.7/site-packages/twisted/internet/defer.py:1475: builtins.RuntimeWarning: coroutine 'RegistrationWorkerStore.get_user_id_by_threepid' was never awaited
2020-10-02 14:48:00,224 - synapse.handlers.auth - 599 - INFO - POST-170 - Logging in user @kr00081893:testsrv.test.com on device IXYUIUIAKJ

And here one from v. 1.20:
2020-10-02 13:47:59,316 - rest_auth_provider - 81 - INFO - POST-28 - Handling profile data
2020-10-02 13:47:59,316 - rest_auth_provider - 92 - INFO - POST-28 - Setting display name to 'Test, Test Tmp (Testuser)' based on profile data
2020-10-02 13:47:59,316 - rest_auth_provider - 99 - INFO - POST-28 - Handling 3PIDs
2020-10-02 13:47:59,316 - rest_auth_provider - 106 - INFO - POST-28 - Looking for 3PID email:[email protected] in user profile
2020-10-02 13:47:59,316 - twisted - 231 - WARNING - POST-28 - /usr/local/lib/python3.7/site-packages/twisted/internet/defer.py:1418: builtins.RuntimeWarning: coroutine 'ProfileWorkerStore.set_profile_displayname' was never awaited
2020-10-02 13:47:59,317 - rest_auth_provider - 119 - INFO - POST-28 - 3PID is present, skipping
2020-10-02 13:47:59,319 - twisted - 231 - WARNING - - /usr/local/lib/python3.7/site-packages/twisted/internet/defer.py:1475: builtins.RuntimeWarning: coroutine 'RegistrationWorkerStore.get_user_id_by_threepid' was never awaited
2020-10-02 13:47:59,336 - synapse.handlers.auth - 696 - INFO - POST-28 - Logging in user @kr00081893:testsrv.test.com on device PGNSSGBAQR

BTW: Both tests state that the 3pids are allready present. Well, the corresponding database table is completely empty.

Best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.