New users are not added to default group when using OIDCBackend
Jira:
@@ -873,7 +873,7 @@ class OIDCBackend(OIDCAuthenticationBackend):
return None
username = default_username_algo(email)
- return self.UserModel.objects.create_user(
+ user = self.UserModel.objects.create_user(
username=username,
email=email,
first_name=first_name,
@@ -881,6 +881,9 @@ class OIDCBackend(OIDCAuthenticationBackend):
is_superuser=self.is_hue_superuser(claims)
)
+ ensure_has_a_group(user)
+ return user
+
def get_or_create_user(self, access_token, id_token, verified_id):
user = super(OIDCBackend, self).get_or_create_user(access_token, id_token, verified_id)
if not user and not import_from_settings('OIDC_CREATE_USER', True):
