diff options
author | Hugh Nimmo-Smith <hughns@matrix.org> | 2022-09-20 12:54:18 +0100 |
---|---|---|
committer | Patrick Cloke <clokep@users.noreply.github.com> | 2023-05-30 09:43:06 -0400 |
commit | d20669971a5be17776a2991c77f5348662bb3902 (patch) | |
tree | d2ccd8d9b6d06e391dd68d8e25fddd1605288549 /synapse/api/auth | |
parent | Record the `sub` claims as an external_id (diff) | |
download | synapse-d20669971a5be17776a2991c77f5348662bb3902.tar.xz |
Use `name` claim as display name when registering users on the fly.
This makes is so that the `name` claim got when introspecting the token is used as the display name when registering a user on the fly.
Diffstat (limited to 'synapse/api/auth')
-rw-r--r-- | synapse/api/auth/oauth_delegated.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/api/auth/oauth_delegated.py b/synapse/api/auth/oauth_delegated.py index 5565ef0a1a..9e01e3fadc 100644 --- a/synapse/api/auth/oauth_delegated.py +++ b/synapse/api/auth/oauth_delegated.py @@ -200,7 +200,14 @@ class OAuthDelegatedAuth(BaseAuth): # TODO: we could use SCIM to provision users ahead of time and listen # for SCIM SET events if those ever become standard: # https://datatracker.ietf.org/doc/html/draft-hunt-scim-notify-00 - await self.store.register_user(user_id=user_id.to_string()) + + # TODO: claim mapping should be configurable + # If present, use the name claim as the displayname + name: Optional[str] = introspection_result.get("name") + + await self.store.register_user( + user_id=user_id.to_string(), create_profile_with_displayname=name + ) # And record the sub as external_id await self.store.record_user_external_id( |