Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Koehler
rdmo-docker-compose
Commits
b639f98d
Commit
b639f98d
authored
Apr 16, 2020
by
Martin Koehler
Browse files
DESY ldap auth added
parent
7953019f
Changes
3
Hide whitespace changes
Inline
Side-by-side
rdmo/dockerfile_master
View file @
b639f98d
...
...
@@ -20,7 +20,10 @@ RUN apt install -y \
libxslt-dev \
zlib1g-dev \
procps \
vim
vim \
python3-ldap \
python-django-auth-ldap \
libsasl2-dev libldap2-dev libssl-dev
# postgres
RUN apt install -y \
...
...
rdmo/rootfs/conf/template_local.py
View file @
b639f98d
...
...
@@ -112,27 +112,27 @@ AUTHENTICATION_BACKENDS.append('allauth.account.auth_backends.AuthenticationBack
LDAP, see also:
http://rdmo.readthedocs.io/en/latest/configuration/authentication/ldap.html
'''
#
import ldap
#
from django_auth_ldap.config import LDAPSearch
#
from rdmo.core.settings import AUTHENTICATION_BACKENDS
#
#
PROFILE_UPDATE = False
#
#
AUTH_LDAP_SERVER_URI = "ldap://ldap
.example.com
"
#
AUTH_LDAP_BIND_DN = "
cn=admin,dc=ldap,dc=example,dc=com
"
#
AUTH_LDAP_BIND_PASSWORD =
"admin"
#
AUTH_LDAP_USER_SEARCH = LDAPSearch("
dc=ldap,dc=example,dc=com
", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
#
#
AUTH_LDAP_USER_ATTR_MAP = {
#
"first_name": "givenName",
#
"last_name": "sn",
#
'email': 'mail'
#
}
#
#
AUTHENTICATION_BACKENDS.insert(
#
AUTHENTICATION_BACKENDS.index('django.contrib.auth.backends.ModelBackend'),
#
'django_auth_ldap.backend.LDAPBackend'
#
)
import
ldap
from
django_auth_ldap.config
import
LDAPSearch
from
rdmo.core.settings
import
AUTHENTICATION_BACKENDS
PROFILE_UPDATE
=
False
AUTH_LDAP_SERVER_URI
=
"ldap
s
://
it-
ldap
-slave.desy.de:1636
"
AUTH_LDAP_BIND_DN
=
"
uid=library1,ou=people,ou=rgy,o=desy,c=de
"
AUTH_LDAP_BIND_PASSWORD
=
os
.
environ
[
"AUTH_LDAP_BIND_PASSWORD"
]
AUTH_LDAP_USER_SEARCH
=
LDAPSearch
(
"
ou=RGY,o=DESY,c=DE
"
,
ldap
.
SCOPE_SUBTREE
,
"(uid=%(user)s)"
)
AUTH_LDAP_USER_ATTR_MAP
=
{
"first_name"
:
"givenName"
,
"last_name"
:
"sn"
,
'email'
:
'mail'
}
AUTHENTICATION_BACKENDS
.
insert
(
AUTHENTICATION_BACKENDS
.
index
(
'django.contrib.auth.backends.ModelBackend'
),
'django_auth_ldap.backend.LDAPBackend'
)
'''
Shibboleth, see also:
...
...
rdmo/rootfs/opt/install-rdmo.sh
View file @
b639f98d
...
...
@@ -14,6 +14,7 @@ git clone ${RDMO_APP_REPO} ${RDMO_APP}
cp
-f
/conf/template_local.py
${
RDMO_APP
}
/config/settings/local.py
pip
install
-r
${
RDMO_APP
}
/requirements/gunicorn.txt
pip
install
-r
${
RDMO_APP
}
/requirements/ldap.txt
cd
${
RDMO_APP
}
python manage.py makemigrations
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment