Initialise user displayname from SAML2 data (#4272)

When we register a new user from SAML2 data, initialise their displayname
correctly.
This commit is contained in:
Richard van der Hoff 2018-12-07 14:44:46 +01:00 committed by GitHub
parent 35e13477cf
commit 30da50a5b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 15 deletions

View file

@ -451,6 +451,7 @@ class SSOAuthHandler(object):
@defer.inlineCallbacks
def on_successful_auth(
self, username, request, client_redirect_url,
user_display_name=None,
):
"""Called once the user has successfully authenticated with the SSO.
@ -467,6 +468,9 @@ class SSOAuthHandler(object):
client_redirect_url (unicode): the redirect_url the client gave us when
it first started the process.
user_display_name (unicode|None): if set, and we have to register a new user,
we will set their displayname to this.
Returns:
Deferred[none]: Completes once we have handled the request.
"""
@ -478,6 +482,7 @@ class SSOAuthHandler(object):
yield self._registration_handler.register(
localpart=localpart,
generate_token=False,
default_display_name=user_display_name,
)
)