Banno / getsentry-ldap-auth

A Sentry extension to add an LDAP server as an authention source.
Apache License 2.0
163 stars 55 forks source link

Add readme for support for sentry 10.0.0, up requirements #49

Closed Galdanwing closed 3 years ago

Galdanwing commented 4 years ago

Had to change signature to support newer version of django-auth-ldap

Tested minimally. Only thing I saw while testing with setup I normally use is this :

File "/usr/local/lib/python2.7/site-packages/sentry/web/forms/accounts.py", line 132, in clean
  self.user_cache = authenticate(username=username, password=password)
File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 70, in authenticate
  user = _authenticate_with_backend(backend, backend_path, request, credentials)
File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 116, in _authenticate_with_backend
  return backend.authenticate(*args, **credentials)
File "/usr/local/lib/python2.7/site-packages/django_auth_ldap/backend.py", line 150, in authenticate
  user = self.authenticate_ldap_user(ldap_user, password)
File "/usr/local/lib/python2.7/site-packages/django_auth_ldap/backend.py", line 210, in authenticate_ldap_user
  return ldap_user.authenticate(password)
File "/usr/local/lib/python2.7/site-packages/django_auth_ldap/backend.py", line 350, in authenticate
  self._get_or_create_user()
File "/usr/local/lib/python2.7/site-packages/django_auth_ldap/backend.py", line 617, in _get_or_create_user
  self._mirror_groups()
File "/usr/local/lib/python2.7/site-packages/django_auth_ldap/backend.py", line 720, in _mirror_groups
  current_group_names = frozenset(self._user.groups.values_list('name', flat=True).iterator())
tributeError: 'User' object has no attribute 'groups'

Which is a result of the AUTH_LDAP_MIRROR_GROUPS option

eugenberend commented 4 years ago

Tested with Sentry 20.8.0. Attempting to log in, Django throws an exeption: django_auth_ldap: save() prohibited to prevent data loss due to unsaved related object 'user' I am not an expirienced Django user, so I've rolled back to original plugin, and it works fine.

Galdanwing commented 4 years ago

Tested with Sentry 20.8.0. Attempting to log in, Django throws an exeption: django_auth_ldap: save() prohibited to prevent data loss due to unsaved related object 'user' I am not an expirienced Django user, so I've rolled back to original plugin, and it works fine.

Hey, This was due to a commit I didn't push. My bad!

zifter commented 3 years ago

Hello everyone! Is it work with the latest version of sentry?

Galdanwing commented 3 years ago

Heya, we no longer use this at our org so I have not had time to check whether this still works, sorry!