diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-11-25 10:04:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 10:04:22 -0500 |
commit | 4fd222ad704767e08c41a60690c4b499ed788b63 (patch) | |
tree | 57df1dd3d93f020a88f9fd592833ba439723b5a5 /docs/sso_mapping_providers.md | |
parent | Add type hints to matrix federation client / agent. (#8806) (diff) | |
download | synapse-4fd222ad704767e08c41a60690c4b499ed788b63.tar.xz |
Support trying multiple localparts for OpenID Connect. (#8801)
Abstracts the SAML and OpenID Connect code which attempts to regenerate the localpart of a matrix ID if it is already in use.
Diffstat (limited to 'docs/sso_mapping_providers.md')
-rw-r--r-- | docs/sso_mapping_providers.md | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/docs/sso_mapping_providers.md b/docs/sso_mapping_providers.md index 707dd73978..dee53b5d40 100644 --- a/docs/sso_mapping_providers.md +++ b/docs/sso_mapping_providers.md @@ -63,13 +63,22 @@ A custom mapping provider must specify the following methods: information from. - This method must return a string, which is the unique identifier for the user. Commonly the ``sub`` claim of the response. -* `map_user_attributes(self, userinfo, token)` +* `map_user_attributes(self, userinfo, token, failures)` - This method must be async. - Arguments: - `userinfo` - A `authlib.oidc.core.claims.UserInfo` object to extract user information from. - `token` - A dictionary which includes information necessary to make further requests to the OpenID provider. + - `failures` - An `int` that represents the amount of times the returned + mxid localpart mapping has failed. This should be used + to create a deduplicated mxid localpart which should be + returned instead. For example, if this method returns + `john.doe` as the value of `localpart` in the returned + dict, and that is already taken on the homeserver, this + method will be called again with the same parameters but + with failures=1. The method should then return a different + `localpart` value, such as `john.doe1`. - Returns a dictionary with two keys: - localpart: A required string, used to generate the Matrix ID. - displayname: An optional string, the display name for the user. |