2021-03-23 17:33:02 +01:00
|
|
|
diff --git a/mygpo/settings.py b/mygpo/settings.py
|
2022-02-02 21:42:33 +01:00
|
|
|
index b3927315..f295c326 100644
|
2021-03-23 17:33:02 +01:00
|
|
|
--- 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
|
2022-02-02 21:42:33 +01:00
|
|
|
|