Allow OAuth 2 login using the username claim if the email is absent from the user profile. #8652
parent
ec3d142ad9
commit
75dc42cf24
|
|
@ -166,11 +166,6 @@ class OAuth2Authentication(BaseAuthentication):
|
|||
]
|
||||
email = profile_dict[email_key[0]] if (len(email_key) > 0) else None
|
||||
|
||||
if not email:
|
||||
error_msg = "No email found in profile data."
|
||||
current_app.logger.exception(error_msg)
|
||||
return False, gettext(error_msg)
|
||||
|
||||
username = email
|
||||
username_claim = None
|
||||
if 'OAUTH2_USERNAME_CLAIM' in self.oauth2_config[
|
||||
|
|
|
|||
Loading…
Reference in New Issue