From 478619c1dd406c45f74f9982eea8531ee4f2a028 Mon Sep 17 00:00:00 2001 From: Patrick Mayr Date: Thu, 23 Mar 2023 17:49:49 +0000 Subject: [PATCH] authentications fix --- fet2020/authentications/authentications.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fet2020/authentications/authentications.py b/fet2020/authentications/authentications.py index e8dd687f..96084b5b 100644 --- a/fet2020/authentications/authentications.py +++ b/fet2020/authentications/authentications.py @@ -14,11 +14,16 @@ def authentication(username, password): if password is None or password.strip() == "": return None - server = Server(host, port=port, use_ssl=True) + server = Server(host, port=port) userdn = f"uid={username},ou=user,dc=fet,dc=htu,dc=tuwien,dc=ac,dc=at" try: - c = Connection(server, user=userdn, password=password, auto_bind=True) + c = Connection(server, user=userdn, password=password) + + # perform the Bind operation + if not c.bind(): + print('error in bind', c.result) + if c.extend.standard.who_am_i(): return username