Skip to content
Snippets Groups Projects
Commit 3c7efba2 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-139: ldap protocol dependent on environment

parent 55eb737e
No related branches found
No related tags found
1 merge request!96Resolve TMSS-139
...@@ -201,10 +201,7 @@ AUTH_LDAP_GLOBAL_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT: ldap.OPT_X_TLS_NEVER } ...@@ -201,10 +201,7 @@ AUTH_LDAP_GLOBAL_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT: ldap.OPT_X_TLS_NEVER }
AUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT : ldap.OPT_X_TLS_NEVER } # cert still expired? AUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT : ldap.OPT_X_TLS_NEVER } # cert still expired?
# AUTH_LDAP_BIND_DN = '' # our LDAP is open # AUTH_LDAP_BIND_DN = '' # our LDAP is open
# AUTH_LDAP_BIND_PASSWORD = '' # our LDAP is open # AUTH_LDAP_BIND_PASSWORD = '' # our LDAP is open
protocol = 'ldaps://' protocol = 'ldap://' if isDevelopmentEnvironment() else 'ldaps://'
if isDevelopmentEnvironment():
logging.warning('Test ldap credentials detected, using insecure connection for ldap autenthication') # mock LDAP does not support ldaps://
protocol = 'ldap://'
AUTH_LDAP_SERVER_URI = "%s%s:%s" % (protocol, django_ldap_credentials.host, django_ldap_credentials.port) AUTH_LDAP_SERVER_URI = "%s%s:%s" % (protocol, django_ldap_credentials.host, django_ldap_credentials.port)
AUTH_LDAP_USER_DN_TEMPLATE="cn=%(user)s,ou=Users,o=lofar,c=eu" AUTH_LDAP_USER_DN_TEMPLATE="cn=%(user)s,ou=Users,o=lofar,c=eu"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment