@@ -85,7 +85,7 @@ If the authentication is unsuccessful, the module must return `None`.
85
85
If multiple modules implement this callback, they will be considered in order. If a
86
86
callback returns `None ` , Synapse falls through to the next one. The value of the first
87
87
callback that does not return `None ` will be used. If this happens, Synapse will not call
88
- any of the subsequent implementations of this callback. If every callback return `None ` ,
88
+ any of the subsequent implementations of this callback. If every callback returns `None ` ,
89
89
the authentication is denied.
90
90
91
91
# ## `on_logged_out`
@@ -162,10 +162,38 @@ return `None`.
162
162
If multiple modules implement this callback, they will be considered in order. If a
163
163
callback returns `None ` , Synapse falls through to the next one. The value of the first
164
164
callback that does not return `None ` will be used. If this happens, Synapse will not call
165
- any of the subsequent implementations of this callback. If every callback return `None ` ,
165
+ any of the subsequent implementations of this callback. If every callback returns `None ` ,
166
166
the username provided by the user is used, if any (otherwise one is automatically
167
167
generated).
168
168
169
+ # ## `get_displayname_for_registration`
170
+
171
+ _First introduced in Synapse v1.54.0_
172
+
173
+ ```python
174
+ async def get_displayname_for_registration(
175
+ uia_results: Dict[str , Any],
176
+ params: Dict[str , Any],
177
+ ) -> Optional[str ]
178
+ ```
179
+
180
+ Called when registering a new user. The module can return a display name to set for the
181
+ user being registered by returning it as a string, or `None ` if it doesn' t wish to force a
182
+ display name for this user.
183
+
184
+ This callback is called once [User- Interactive Authentication](https:// spec.matrix.org/ latest/ client- server- api/ # user-interactive-authentication-api)
185
+ has been completed by the user. It is not called when registering a user via SSO . It is
186
+ passed two dictionaries, which include the information that the user has provided during
187
+ the registration process. These dictionaries are identical to the ones passed to
188
+ [`get_username_for_registration` ](# get_username_for_registration), so refer to the
189
+ documentation of this callback for more information about them.
190
+
191
+ If multiple modules implement this callback, they will be considered in order. If a
192
+ callback returns `None ` , Synapse falls through to the next one. The value of the first
193
+ callback that does not return `None ` will be used. If this happens, Synapse will not call
194
+ any of the subsequent implementations of this callback. If every callback returns `None ` ,
195
+ the username will be used (e.g. `alice` if the user being registered is `@ alice:example.com` ).
196
+
169
197
# # `is_3pid_allowed`
170
198
171
199
_First introduced in Synapse v1.53.0_
@@ -194,8 +222,7 @@ The example module below implements authentication checkers for two different lo
194
222
- Is checked by the method: `self .check_my_login`
195
223
- `m.login.password` (defined in [the spec](https:// matrix.org/ docs/ spec/ client_server/ latest# password-based))
196
224
- Expects a `password` field to be sent to `/ login`
197
- - Is checked by the method: `self .check_pass`
198
-
225
+ - Is checked by the method: `self .check_pass`
199
226
200
227
```python
201
228
from typing import Awaitable, Callable, Optional, Tuple
0 commit comments