diff --git a/photonix/web/settings.py b/photonix/web/settings.py index 45ba924..96d6dd4 100644 --- a/photonix/web/settings.py +++ b/photonix/web/settings.py @@ -16,6 +16,7 @@ from pathlib import Path from .utils import get_secret_key +import ldap # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = str(Path(__file__).parent.parent.resolve()) @@ -133,12 +134,17 @@ LOGGING = { } AUTHENTICATION_BACKENDS = [ + 'django_auth_ldap.backend.LDAPBackend', 'graphql_jwt.backends.JSONWebTokenBackend', 'django.contrib.auth.backends.ModelBackend', ] AUTH_USER_MODEL = 'accounts.User' +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"} + # Password validation # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators