summary refs log tree commit diff
path: root/latest/modules/password_auth_provider_callbacks.html
diff options
context:
space:
mode:
authorreivilibre <reivilibre@users.noreply.github.com>2022-03-08 15:38:01 +0000
committerreivilibre <reivilibre@users.noreply.github.com>2022-03-08 15:38:01 +0000
commit8a540c45ecfb30eebe4c9873dbe6c8bab45a640b (patch)
treec66f066fc1dd3094b54985138403903f2807d3e0 /latest/modules/password_auth_provider_callbacks.html
parentdeploy: 4aeb00ca20a0d9dbb2a104591aca081c723eb6d9 (diff)
downloadsynapse-8a540c45ecfb30eebe4c9873dbe6c8bab45a640b.tar.xz
deploy: b1989ced00cc0bc6214bfd1a393c7e8f8eda660c
Diffstat (limited to 'latest/modules/password_auth_provider_callbacks.html')
-rw-r--r--latest/modules/password_auth_provider_callbacks.html27
1 files changed, 24 insertions, 3 deletions
diff --git a/latest/modules/password_auth_provider_callbacks.html b/latest/modules/password_auth_provider_callbacks.html
index 8e827ebc9a..768b702e26 100644
--- a/latest/modules/password_auth_provider_callbacks.html
+++ b/latest/modules/password_auth_provider_callbacks.html
@@ -246,7 +246,7 @@ If the module doesn't wish to return a callback, it must return None instead.</p
 <p>If multiple modules implement this callback, they will be considered in order. If a
 callback returns <code>None</code>, Synapse falls through to the next one. The value of the first
 callback that does not return <code>None</code> will be used. If this happens, Synapse will not call
-any of the subsequent implementations of this callback. If every callback return <code>None</code>,
+any of the subsequent implementations of this callback. If every callback returns <code>None</code>,
 the authentication is denied.</p>
 <h3 id="on_logged_out"><a class="header" href="#on_logged_out"><code>on_logged_out</code></a></h3>
 <p><em>First introduced in Synapse v1.46.0</em></p>
@@ -306,9 +306,30 @@ return <code>None</code>.</p>
 <p>If multiple modules implement this callback, they will be considered in order. If a
 callback returns <code>None</code>, Synapse falls through to the next one. The value of the first
 callback that does not return <code>None</code> will be used. If this happens, Synapse will not call
-any of the subsequent implementations of this callback. If every callback return <code>None</code>,
+any of the subsequent implementations of this callback. If every callback returns <code>None</code>,
 the username provided by the user is used, if any (otherwise one is automatically
 generated).</p>
+<h3 id="get_displayname_for_registration"><a class="header" href="#get_displayname_for_registration"><code>get_displayname_for_registration</code></a></h3>
+<p><em>First introduced in Synapse v1.54.0</em></p>
+<pre><code class="language-python">async def get_displayname_for_registration(
+    uia_results: Dict[str, Any],
+    params: Dict[str, Any],
+) -&gt; Optional[str]
+</code></pre>
+<p>Called when registering a new user. The module can return a display name to set for the
+user being registered by returning it as a string, or <code>None</code> if it doesn't wish to force a
+display name for this user.</p>
+<p>This callback is called once <a href="https://spec.matrix.org/latest/client-server-api/#user-interactive-authentication-api">User-Interactive Authentication</a>
+has been completed by the user. It is not called when registering a user via SSO. It is
+passed two dictionaries, which include the information that the user has provided during
+the registration process. These dictionaries are identical to the ones passed to
+<a href="#get_username_for_registration"><code>get_username_for_registration</code></a>, so refer to the
+documentation of this callback for more information about them.</p>
+<p>If multiple modules implement this callback, they will be considered in order. If a
+callback returns <code>None</code>, Synapse falls through to the next one. The value of the first
+callback that does not return <code>None</code> will be used. If this happens, Synapse will not call
+any of the subsequent implementations of this callback. If every callback returns <code>None</code>,
+the username will be used (e.g. <code>alice</code> if the user being registered is <code>@alice:example.com</code>).</p>
 <h2 id="is_3pid_allowed"><a class="header" href="#is_3pid_allowed"><code>is_3pid_allowed</code></a></h2>
 <p><em>First introduced in Synapse v1.53.0</em></p>
 <pre><code class="language-python">async def is_3pid_allowed(self, medium: str, address: str, registration: bool) -&gt; bool
@@ -335,7 +356,7 @@ any of the subsequent implementations of this callback.</p>
 <li><code>m.login.password</code> (defined in <a href="https://matrix.org/docs/spec/client_server/latest#password-based">the spec</a>)
 <ul>
 <li>Expects a <code>password</code> field to be sent to <code>/login</code></li>
-<li>Is checked by the method: <code>self.check_pass</code> </li>
+<li>Is checked by the method: <code>self.check_pass</code></li>
 </ul>
 </li>
 </ul>