LDAP intregration

Questions, comments, discussions. Over time certain topics might be moved to their own category.
Post Reply
christian
Posts: 2
Joined: Tue Apr 27, 2021 8:00 am

LDAP intregration

Post by christian »

Hi I have big problems to connect an external LDAP server. I have searched various forums for solutions and nothing has worked so far.

I have installed pyhton-ldap and django-auth-ldap.

But in which folder under which path must the settings.py or __init__.py must configure.
User avatar
michael
Developer
Developer
Posts: 94
Joined: Sun Apr 19, 2020 6:21 am

Re: LDAP intregration

Post by michael »

Hi, This will depend on your installation method. Check the following chapter for a more extensive explanation and example: https://docs.mayan-edms.com/chapters/se ... ings-files
christian
Posts: 2
Joined: Tue Apr 27, 2021 8:00 am

Re: LDAP intregration

Post by christian »

Thank you that helped a lot.

Now another problem has arisen that although the things are configured correctly mayan but does not load the config.py.

This is the Log

2021-05-06 10:54:24,313 mayan.apps.logging.middleware.error_logging <66052> [ERROR] "process_exception() line 15 Exception caught by request middleware; <WSGIRequest: POST '/authentication/login/'>, AUTH_LDAP_USER_SEARCH must be an LDAPSearch instance."
Traceback (most recent call last):
File "/opt/mayan-edms/lib/python3.8/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/utils/decorators.py", line 45, in _wrapper
return bound_method(*args, **kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/stronghold/views.py", line 8, in dispatch
return super(StrongholdPublicMixin, self).dispatch(*args, **kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/utils/decorators.py", line 45, in _wrapper
return bound_method(*args, **kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
return view(request, *args, **kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/utils/decorators.py", line 45, in _wrapper
return bound_method(*args, **kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/utils/decorators.py", line 142, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/utils/decorators.py", line 45, in _wrapper
return bound_method(*args, **kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/contrib/auth/views.py", line 61, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/views/generic/base.py", line 97, in dispatch
return handler(request, *args, **kwargs)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/views/generic/edit.py", line 141, in post
if form.is_valid():
File "/opt/mayan-edms/lib/python3.8/site-packages/django/forms/forms.py", line 185, in is_valid
return self.is_bound and not self.errors
File "/opt/mayan-edms/lib/python3.8/site-packages/django/forms/forms.py", line 180, in errors
self.full_clean()
File "/opt/mayan-edms/lib/python3.8/site-packages/django/forms/forms.py", line 382, in full_clean
self._clean_form()
File "/opt/mayan-edms/lib/python3.8/site-packages/django/forms/forms.py", line 409, in _clean_form
cleaned_data = self.clean()
File "/opt/mayan-edms/lib/python3.8/site-packages/django/contrib/auth/forms.py", line 205, in clean
self.user_cache = authenticate(self.request, username=username, password=password)
File "/opt/mayan-edms/lib/python3.8/site-packages/django/contrib/auth/__init__.py", line 73, in authenticate
user = backend.authenticate(request, **credentials)
File "/opt/mayan-edms/lib/python3.8/site-packages/django_auth_ldap/backend.py", line 153, in authenticate
user = self.authenticate_ldap_user(ldap_user, password)
File "/opt/mayan-edms/lib/python3.8/site-packages/django_auth_ldap/backend.py", line 211, in authenticate_ldap_user
return ldap_user.authenticate(password)
File "/opt/mayan-edms/lib/python3.8/site-packages/django_auth_ldap/backend.py", line 353, in authenticate
self._authenticate_user_dn(password)
File "/opt/mayan-edms/lib/python3.8/site-packages/django_auth_ldap/backend.py", line 481, in _authenticate_user_dn
if self.dn is None:
File "/opt/mayan-edms/lib/python3.8/site-packages/django_auth_ldap/backend.py", line 446, in dn
self._load_user_dn()
File "/opt/mayan-edms/lib/python3.8/site-packages/django_auth_ldap/backend.py", line 521, in _load_user_dn
self._user_dn = self._search_for_user_dn()
File "/opt/mayan-edms/lib/python3.8/site-packages/django_auth_ldap/backend.py", line 538, in _search_for_user_dn
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: AUTH_LDAP_USER_SEARCH must be an LDAPSearch instance.
Post Reply