@@ -304,7 +304,7 @@ it should register the following dict:
304304` ` ` python
305305{
306306 "com.example.custom_login": ("secret1", "secret2"),
307- "m.login.password": ("password",)
307+ "m.login.password": ("password",),
308308}
309309` ` `
310310
@@ -396,6 +396,22 @@ The module's author should also update any example in the module's configuration
396396use the new `modules` section in Synapse's configuration file (see [this section](#using-modules)
397397for more info).
398398
399+ # ### Porting password auth provider modules
400+
401+ There is no longer a `get_db_schema_files` callback provided, any changes to the database
402+ should now be made by the module using the module API class.
403+
404+ To port a module that has a `check_password` method :
405+ - Register `"m.login.password" : ("password",)` as a supported login type
406+ - Register `"m.login.password" : self.check_password` as an auth checker
407+ - Change the arguments of `check_password` to
408+ `(username : str, login_type: str, login_dict: JsonDict)`
409+ - Add the following lines to the top of the `check_password` method :
410+ - ` user_id = self.module_api.get_qualified_user_id(username)`
411+ - ` password = login_dict["password"]`
412+ - Alter `check_password` so that it returns `None` on an authentication failure, and `user_id`
413+ on a success
414+
399415# ## Example
400416
401417The example below is a module that implements the spam checker callback
0 commit comments