0

I am trying to use LDAP python link to use this function. I am simply trying to implement this as a function . Passing parameters something like this:

check_credentials(username="xxxxxx",password="xxx")

But it goes into hanged state and after 5-7 mins it completes execution with no output. Can someone suggets me some good article for this

Shashank Vivek
  • 16,888
  • 8
  • 62
  • 104
  • Based on the last lines: if all goes well, the function will fill search results into `cherrypy.session` (whatever it is), closes connection and then returns None. – Berci Feb 16 '16 at 11:35
  • @Berci: Well I am passing wrong credentials. I am expecting `except ldap.INVALID_CREDENTIALS:` – Shashank Vivek Feb 16 '16 at 11:42

1 Answers1

0

From looking at your sample code, the LDAP_USER_NAME is a not in the expected DN (distinguished name) format. Typically, Active Directory users have a DN in the format of cn=<username>,cn=users,<domain>. For example, user bjensen in the example.com domain typically would have this DN: cn=bjensen,cn=users,dc=example,dc=com

My guess is that either Active Directory or the Python LDAP library may not return invalid credentials if the DN part is incorrect.

Bertold Kolics
  • 892
  • 6
  • 11