I am using python-ldap to try to authenticate against an existing Active Directory, and when I use the following code:
import ldap
l = ldap.initialize('LDAP://example.com')
m = l.simple_bind_s([email protected],password)
I get the following back:
print m
(97, [])
What does the 97 and empty list signify coming from a Microsoft Active Directory server?
I gather this is a successful authentication since it doesn't error (which it does if you use the wrong password or non-existent username), but I'd like to know if the tuple means something useful.
The first item is a status code (97=success) followed by a list of messages from the server. See here in the section Binding.
According to the documentation, this is:
LDAP_REFERRAL_LIMIT_EXCEEDED 0x61 The referral limit was exceeded.
Probably
ldap.set_option(ldap.OPT_REFERRALS, 0)
could help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With