diff --git a/mygpo/settings.py b/mygpo/settings.py index 33bd283f..2666ade6 100644 --- a/mygpo/settings.py +++ b/mygpo/settings.py @@ -2,6 +2,7 @@ import re import sys import os.path import dj_database_url +import ldap try: @@ -209,10 +210,15 @@ except ImportError: ACCOUNT_ACTIVATION_DAYS = int(os.getenv("ACCOUNT_ACTIVATION_DAYS", 7)) AUTHENTICATION_BACKENDS = ( + "django_auth_ldap.backend.LDAPBackend", "mygpo.users.backend.CaseInsensitiveModelBackend", "mygpo.web.auth.EmailAuthenticationBackend", ) +AUTH_LDAP_USER_DN_TEMPLATE = "uid=%(user)s,ou=users,dc=yunohost,dc=org" + +AUTH_LDAP_USER_ATTR_MAP = {"username": "uid", "first_name": "givenName", "email": "mail", "last_name": "sn"} + SESSION_ENGINE = "django.contrib.sessions.backends.cached_db" # TODO: use (default) JSON serializer for security