]> git.parisson.com Git - mezzo.git/commitdiff
[LDAP] : as optionnal authentication
authorEmilie <zawadzki@ircam.fr>
Fri, 1 Dec 2017 10:03:26 +0000 (11:03 +0100)
committerEmilie <zawadzki@ircam.fr>
Fri, 1 Dec 2017 10:03:26 +0000 (11:03 +0100)
app/settings.py
lib/mezzanine-organization
requirements.txt

index bddea86a9c1fd458d161e9a5ab1b94b5ad49d207..4126d5572e8257cceb43704d1c7f06c7558e3c9b 100644 (file)
@@ -24,6 +24,8 @@ from __future__ import absolute_import, unicode_literals
 
 import os
 from django.utils.translation import ugettext_lazy as _
+import ldap, logging
+from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
 
 DEBUG = True if os.environ.get('DEBUG') == 'True' else False
 
@@ -144,8 +146,12 @@ SITE_ID = 1
 USE_I18N = True
 USE_L10N = True
 
-AUTHENTICATION_BACKENDS = ("mezzanine.core.auth_backends.MezzanineBackend",
-                            "guardian.backends.ObjectPermissionBackend",)
+AUTHENTICATION_BACKENDS = (
+#   Activate Auth LDAP : 
+#   "organization.core.backend.OrganizationLDAPBackend",
+    "mezzanine.core.auth_backends.MezzanineBackend",
+    "guardian.backends.ObjectPermissionBackend",
+)
 
 #########
 # PATHS #
@@ -599,6 +605,25 @@ if DEBUG :
     HIJACK_REGISTER_ADMIN = True
 
 
+
+##############################################
+##########  AUTHENTIFICATION LDAP  ###########
+##############################################
+# You can use LDAP Authentication by using 'Django Auth LDAP'#
+
+# 1 - Activate logging :
+# logging
+# if DEBUG:
+#     logger = logging.getLogger('django_auth_ldap')
+#     logger.addHandler(logging.StreamHandler())
+#     logger.setLevel(logging.DEBUG)
+
+# 2 - Specify your LDAP settings :
+# https://django-auth-ldap.readthedocs.io/en/latest/
+
+# 3 - Activate LDAP Backend 
+# Please see AUTHENTICATION_BACKENDS
+
 ##################
 # LOCAL SETTINGS #
 ##################
index 2e262b435384f2d266ca3faf1a34a19e99ee2195..0dc91551ecadc3b12d5502dcbb16fda0e15bb636 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 2e262b435384f2d266ca3faf1a34a19e99ee2195
+Subproject commit 0dc91551ecadc3b12d5502dcbb16fda0e15bb636
index f910c2a5eb354913374bcd1598e51c5d2c5dd97e..1553b78fd73d73d3312363beae28f8758a71626c 100644 (file)
@@ -10,3 +10,6 @@ vim
 ruby
 ruby-dev
 gettext
+libsasl2-dev
+python3-dev
+libldap2-dev