Questions tagged [python-ldap]

python-ldap provides an object-oriented API to access LDAP directory servers from Python programs

python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It wraps the OpenLDAP 2.x library.

Additionally the package contains several LDAP-related utilities for processing:

  • LDIF,
  • LDAPURLs,
  • LDAPv3 schema.

Reference:

243 questions
8
votes
2 answers

Python-LDAP simple_bind_s timeout

Is there a way to set timeout for "simple_bind_s" in python-LDAP manually? I have tested ldapObject.timeout = 10 it did not work for me. Any ideas? Thanks in advance..
kursat
  • 1,059
  • 5
  • 15
  • 32
8
votes
2 answers

HOW-TO: LDAP bind+authenticate using python-ldap

Could you please advise on how to troubleshoot the attempt below; am trying to bind to a ldap server, but in vain, when I do openssl s_client -CApath /etc/pki/ca-trust/source/anchors/ -connect ...:636 It succeeds : Verify return code: 0…
nskalis
  • 2,232
  • 8
  • 30
  • 49
8
votes
1 answer

Python-ldap set_option not working on Yosemite

We've installed the python-ldap(2.4.19) module without errors and perform most of the operations successfully. However ldap.set_option always returns a exception when we try to load certificates to use ssl (ldaps). It occurs on notebooks running…
Nelson Marcos
  • 477
  • 2
  • 16
7
votes
4 answers

python-ldap OS X 10.6 and Python 2.6

Trying to install python-ldap for my Django project -- so far tried easy_install, pip, as well as building myself, but still getting the same errors: dlopen(/Library/Python/2.6/site-packages/_ldap.so, 2): Symbol not found:…
Brian D
  • 9,863
  • 18
  • 61
  • 96
7
votes
2 answers

How should I escape ldap special characters?

I'm using python-ldap to query Active Directory I have this DN CN=Whalen\, Sean,OU=Users,OU=Users and Groups,DC=example,DC=net That works fine as a base in a query, but if I try to use it in a search filter like…
Sean W.
  • 4,944
  • 8
  • 40
  • 66
7
votes
4 answers

How to retrieve all the attributes of LDAP database

I am using ldap module of python to connect to ldap server. I am able to query the database but I dont know how to retrieve the fields present in the database, so that I can notify the user in advance to quering the database, telling him that the…
ashokadhikari
  • 1,182
  • 3
  • 15
  • 29
6
votes
3 answers

Python LDAP write attribute to Active Directory

I am able to bind and query Active Directory via python-ldap without any issues except when it comes to adding or modifying attributes on AD. I can add the attribute but the encoding seems to be way off as all the text is garbled. I've tried…
xXPhenom22Xx
  • 1,265
  • 5
  • 29
  • 63
5
votes
1 answer

How do I search for an object in LDAP based on its dn, in python-ldap?

I am trying to use e.g. the search_s function to search for an object based on its full distinguished name, but am not finding this to be convenient. For example, search_s('DC=example, DC=com', ldap.SCOPE_SUBTREE, '(CN=Somebody, OU=Department,…
joeforker
  • 40,459
  • 37
  • 151
  • 246
5
votes
2 answers

change password with python-ldap

I want change password on ldap user. The script is: def changePassword(url,binddn,pw, newpw): l = ldap.initialize(url) ldap. try: l.protocol_version=ldap.VERSION3 l.simple_bind_s(binddn,pw) except: print "Error Bind in changePassword" …
sixart
  • 147
  • 1
  • 2
  • 6
5
votes
3 answers

python-ldap failed to install in Heroku

It seems like Heroku does not support python-ldap. The pip install with "python-ldap==2.3.13" in the requirements.txt file failed with following error in Heroku: gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall…
yongwen
  • 81
  • 3
4
votes
0 answers

Bind LDAP connection to SASL auth using python-ldap

How can I bind an LDAP connection using SASL auth using the python-ldap module? Should I configure anything specific on the Windows AD DC side as well? Here's my code which raises an InvalidCredentials error import ldap import ldap.sasl HOST =…
4
votes
0 answers

Centos7: python-ldap installation with pip

I have asked this question before and was solved by gcc installation but I am currently migrating the app to production machine. I have installed gcc, python-devel, openssl-devel, kernel-devel, openldap-devel, I even tried yum groupinstall…
JMY
  • 57
  • 1
  • 7
4
votes
1 answer

Use ldap3 to query all active directory groups a user belongs to

I have no problem to query the domain user from active directory with this query from ldap3 import ObjectDef, AttrDef, Reader, Entry, Attribute, OperationalAttribute import ldap3 person = ObjectDef('inetOrgPerson') s = ldap3.Server('myad.com') c =…
zs2020
  • 53,766
  • 29
  • 154
  • 219
4
votes
1 answer

global options in python ldap

I was playing with python ldap in console and got results which I can't explain. Hope somebody can clarify this for me. open new python console import ldap certfile = '~/ad-server.test.loc.pem' ldap.set_option(ldap.OPT_X_TLS_CACERTFILE,…
4
votes
2 answers

Delete recursively a LDAP subtree with python

Using python-ldap, I want to delete an entire subtree of my LDAP tree. I came up with : def ldap_recursive_delete_s(con, base_dn): search = con.search_s(base_dn, ldap.SCOPE_SUBTREE) delete_list = [dn for dn, _ in search] …
Jocelyn delalande
  • 5,123
  • 3
  • 30
  • 34
1
2
3
16 17