Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the LDAP response tuple (97, []) mean?

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.

like image 928
Technical Bard Avatar asked Jan 27 '09 00:01

Technical Bard


2 Answers

The first item is a status code (97=success) followed by a list of messages from the server. See here in the section Binding.

like image 51
Kosi2801 Avatar answered Nov 15 '22 18:11

Kosi2801


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.

like image 27
phihag Avatar answered Nov 15 '22 16:11

phihag