Skip to content

Commit

Permalink
check if ldap authentication is used
Browse files Browse the repository at this point in the history
  • Loading branch information
multiflexi committed Jul 29, 2024
1 parent 4e2918f commit 6217739
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/auth/ldap_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ class LDAPAuthenticator(BaseAuthenticator):

LDAP_SERVER = os.getenv("LDAP_SERVER")
LDAP_BASE_DN = os.getenv("LDAP_BASE_DN")
# Check if the LDAP CA certificate path is set in the environment variables or the certificate is in the default path
# Custom path
if os.getenv("LDAP_CA_CERT_PATH") not in [None, ""]:
LDAP_CA_CERT_PATH = os.getenv("LDAP_CA_CERT_PATH")
# Default path
elif os.path.isfile("auth/ldap_ca.pem"):
LDAP_CA_CERT_PATH = "auth/ldap_ca.pem"
else:
# No path and authentication method is LDAP
elif os.getenv("TARANIS_NG_AUTHENTICATOR").casefold() == "ldap":
log_manager.store_auth_error_activity("No LDAP CA certificate found. LDAP authentication might not work.")

def get_required_credentials(self):
Expand Down

0 comments on commit 6217739

Please sign in to comment.