Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Modules system: callback for on_login which includes the deviceName from the client #10487

Open
benparsons opened this issue Jul 27, 2021 · 3 comments
Labels
A-Login A-Modules Module API: https://matrix-org.github.io/synapse/latest/modules/index.html T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@benparsons
Copy link
Member

I'm looking at https://matrix-org.github.io/synapse/develop/modules.html and don't see a callback for on_login. I'd like a callback that contains the deviceName for the user logging in.

cc @babolivier @chagai95

@babolivier
Copy link
Contributor

Will be fixed by porting the auth provider module interface to the new one (tracked as part of #10469)

@clokep
Copy link
Member

clokep commented Jul 27, 2021

Note that you can do this already with password auth providers: https://matrix-org.github.io/synapse/develop/password_auth_providers.html

When porting to the new module system (#10469) we should probably make this particular callback not dependent on being related to password providers. (I.e. why not have this for an SSO user too?)

@reivilibre reivilibre added the T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. label Jul 27, 2021
@MadLittleMods MadLittleMods added A-Modules Module API: https://matrix-org.github.io/synapse/latest/modules/index.html A-Login labels Mar 14, 2023
@anoadragon453
Copy link
Member

anoadragon453 commented Mar 22, 2023

I don't think any of the password auth provider callbacks will help here if a user is logging in via the m.login.password User-Interactive Authentication type (which is often used) or via SSO.

  1. Registering a check_auth callback does not allow you to override m.login.password nor m.login.sso.
  2. check_3pid_auth will only fire if a user logs in with a third-party ID (email or phone number), which also does not work for password or SSO logins.

Therefore I think we still need a on_user_login callback which provides:

  1. The user's Matrix ID.
  2. The login type (m.login.password, m.login.sso).
  3. This device's ID.

We could then add another Module API method that allows modules to get the displayname of a device given the ID.

Putting it under the Account Validity callbacks (next to on_user_registration) makes the most sense to me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Login A-Modules Module API: https://matrix-org.github.io/synapse/latest/modules/index.html T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

No branches or pull requests

7 participants
@clokep @MadLittleMods @benparsons @anoadragon453 @babolivier @reivilibre and others