diff --git a/netbox/netbox/authentication.py b/netbox/netbox/authentication.py index 2bd15f08e..17b9eefd6 100644 --- a/netbox/netbox/authentication.py +++ b/netbox/netbox/authentication.py @@ -153,9 +153,11 @@ class RemoteUserBackend(_RemoteUserBackend): except UserModel.DoesNotExist: pass if self.user_can_authenticate(user): - if remote_groups: + if settings.REMOTE_AUTH_GROUP_SYNC_ENABLED: if user is not None and not isinstance(user, AnonymousUser): return self.configure_groups(user,remote_groups) + else: + return user else: return None