Added support for LDAP authentication with different DN by setting the dedicated user for the LDAP connection. Fixes #5484

This commit is contained in:
Khushboo Vashi
2020-07-06 19:35:55 +05:30
committed by Akshay Joshi
parent a6ce78a8c0
commit 58b4c45d0c
5 changed files with 79 additions and 12 deletions

View File

@@ -29,6 +29,9 @@ class LDAPLoginTestCase(BaseTestGenerator):
('LDAP With TLS Authentication', dict(
config_key_param='ldap_with_tls',
is_gravtar_image_check=False)),
('LDAP With Dedicated User Authentication', dict(
config_key_param='ldap_with_dedicated_user',
is_gravtar_image_check=False)),
]
@classmethod
@@ -59,6 +62,10 @@ class LDAPLoginTestCase(BaseTestGenerator):
app_config.LDAP_CA_CERT_FILE = ldap_config['ca_cert_file']
app_config.LDAP_CERT_FILE = ldap_config['cert_file']
app_config.LDAP_KEY_FILE = ldap_config['key_file']
if ldap_config['bind_user'] != "" and\
ldap_config['bind_password'] != "":
app_config.LDAP_BIND_USER = ldap_config['bind_user']
app_config.LDAP_BIND_PASSWORD = ldap_config['bind_password']
else:
self.skipTest(
"LDAP config not set."