-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestLdaps.py
39 lines (27 loc) · 914 Bytes
/
testLdaps.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Provides functions to test LDAPS endpoints.
# Module Version 0.1.0
# (C) 2021 Fred Boniface, distributed under the GPLv3 License, a copy of which
# is included with this software.
import ldap
from settings import Parse
def tryLdap(url):
# try:
# Get LDAP settings from settings.Parse and separate User & Pass
conf = Parse.parseConf('ldaps')
ldapUser = conf.get('bindUser')
ldapPass = conf.get('bindPass')
ldapBase = conf.get('userPath')
ldapLogin = ldapUser + ", " + ldapBase
print(ldapBase)
print(ldapLogin)
# Connect and bind to LDAPS
# connect = ldap.initialize(url)
# connect.set_option(ldap.OPT_REFERRALS, 0)
# connect.simple_bind_s(ldapUser, ldapPass)
print(conf)
print("\n")
print(ldapUser)
print(ldapPass)
return "Done"
# except:
# return "Fail"