Commit 0ae0bd87 authored by Bunde's avatar Bunde
Browse files

Merge branch '2018-04-tb-ldap' into 'master'

2018 04 tb ldap

See merge request !10
parents 2836e11e 6a080606
Pipeline #148 passed with stage
in 16 seconds
......@@ -70,6 +70,10 @@ AUTH_PASSWORD_VALIDATORS = [
},
]
AUTHENTICATION_BACKENDS = [
"django.contrib.auth.backends.ModelBackend",
]
AUTH_USER_MODEL = 'castellum_auth.User'
LOGIN_REDIRECT_URL = '/'
......
import ldap
import os
from django_auth_ldap.config import LDAPSearch
from .default import *
# FIXME: These values need to be changed
SECRET_KEY = 'i#$kwk(s24ysn+l%+c!*z9u4+45)oex!-s#!bux#wf2pv2cc0d'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
ALLOWED_HOSTS = [
'localhost',
]
# LDAP
# See https://django-auth-ldap.readthedocs.io/
AUTHENTICATION_BACKENDS.append("django_auth_ldap.backend.LDAPBackend")
AUTH_LDAP_SERVER_URI = 'ldap://localhost'
AUTH_LDAP_BIND_DN = 'cn=admin,dc=example,dc=org'
AUTH_LDAP_BIND_PASSWORD = 'admin'
AUTH_LDAP_USER_SEARCH = LDAPSearch('dc=example,dc=org', ldap.SCOPE_SUBTREE, '(uid=%(user)s)')
......@@ -11,6 +11,7 @@ setup(
install_requires=[
"Django==2.0.4",
"django-auth-ldap==1.4.0",
"django-bootstrap4==0.0.6",
"django-npm==1.0.0"
],
......
version: '2'
services:
ldap:
container_name: ldap
image: osixia/openldap
ports:
- "389:389"
command: [--copy-service]
volumes:
- ./ldap/dummy_data.ldif:/container/service/slapd/assets/config/bootstrap/ldif/data.ldif
dn: cn=alice,dc=example,dc=org
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
cn: alice
uid: alice
userPassword: password
uidNumber: 1000
gidNumber: 1000
givenName: Alice
sn: Adams
homeDirectory: /home/alice
dn: cn=bob,dc=example,dc=org
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
cn: bob
uid: bob
userPassword: password
uidNumber: 1001
gidNumber: 50
givenName: Robert
sn: Barker
homeDirectory: /home/bob
......@@ -5,4 +5,5 @@ exclude=
node_modules,
wsgi.py,
migrations,
settings,
max-line-length=100
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment