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
348
votes
27 answers

I can't install python-ldap

When I run the following command: sudo pip install python-ldap I get this error: In file included from Modules/LDAPObject.c:9: Modules/errors.h:8: fatal error: lber.h: No such file or directory How can I fix this?
VacuumTube
  • 4,021
  • 4
  • 22
  • 19
22
votes
7 answers

Detect if an Active Directory user account is locked using LDAP in Python

I'm validating user logins using python's ldap module. When the login fails, I get a ldap.INVALID_CREDENTIALS login, but this can be either because of a wrong password or because the account is locked. The account get's locked after the 3rd try. I…
Daniel Reis
  • 12,944
  • 6
  • 43
  • 71
20
votes
3 answers

Python Poetry: how to specify platform-specific dependency alternatives?

Some background: The project I'm working on uses python-ldap library. Since we are a mixed-OS development team (some use Linux, some macOS and some Windows), I'm trying to make the project build on all environments. Unfortunately, python-ldap is…
Igor Brejc
  • 18,714
  • 13
  • 76
  • 95
18
votes
3 answers

Installing python-ldap fails with lber.h file not found in ubuntu 17.10 even after installing devel packages

I am trying to install python-ldap package using pip. I am getting the below error while executing pip install python-ldap. I tried installing the package corresponding to ubuntu 17.10 ( Artful ) as per this question but no luck yet. What package am…
Bill Goldberg
  • 1,699
  • 5
  • 26
  • 50
17
votes
3 answers

Python+LDAP+SSL

Good day. In advance, I apologize for my English, my national forums and resources did not help. I am making a script that either changes or creates a user's password in AD After studying the issue, it became clear that Password to assign or change…
ellerseer
  • 556
  • 1
  • 4
  • 8
16
votes
2 answers

run python-ldap with official python docker image as base

I am using the official python docker image for python 2.7. The application I am working with requires pyhon-ldap. My dockerfile looked like this: FROM python:2.7 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD requirements.txt…
fishpen0
  • 619
  • 1
  • 10
  • 23
15
votes
2 answers

Authenticating to Active Directory with python-ldap always returns (97, [])

Similar to this question, I am trying to perform simple authentication to a 2003 Active Directory using python ldap (CentOS 6.2 x86_64, Python 2.6.6, python-ldap 2.3.10). Despite following all the usual steps in the init,…
Chris Doherty
  • 525
  • 1
  • 4
  • 12
13
votes
4 answers

Python-ldap not able to bind successfully

I am not having any luck finding answers on this, so here it goes. When I attemtp to connect to an AD server using python-ldap, it appears to work successfully for some functions, and not for others. My connection: >>>import sys >>>import ldap >>>l…
Titus P
  • 959
  • 1
  • 7
  • 16
13
votes
1 answer

Conditional __debug__ statement not executed though __debug__ is True

Short Version I have a section of code I'm debugging that checks the value of __debug__ and executes some code if it is True. if __debug__: The problem is that "stuff" never happens, even though __debug__ appears to be True. Long…
turtlemonvh
  • 9,149
  • 6
  • 47
  • 53
11
votes
2 answers

ldap3 python add user to group

I'm writing a small script using python-ldap3 to generate dummy users and groups. I'm having trouble linking a user with a group. After running this snippet there are no changes in my Active Directory…
Anton Bezkrovnyy
  • 171
  • 1
  • 1
  • 6
10
votes
2 answers

python-ldap add_s fails to add attribute for AD user with OBJECT_CLASS_VIOLATION

I get an OBJECT_CLASS_VIOLATION when trying to add an attribute. Modifying an existing attribute works just fine (even this same attribute, if I add it from AD first, then mod it). First I kinit as a domain admin, then: import ldap, ldap.sasl l =…
David Mulder
  • 7,595
  • 11
  • 45
  • 61
10
votes
1 answer

How do I force Python LDAP to validate/verify an SSL certificate when using .start_tls_s()

I've been trying to use Python-LDAP (version 2.4.19) under MacOS X 10.9.5 and Python 2.7.9 I want to validate my connection to a given LDAP server after I've called the .start_tls_s() (or to have the method raise and exception if the certificate…
Jim Dennis
  • 17,054
  • 13
  • 68
  • 116
10
votes
2 answers

Resolve GCC error when installing python-ldap on Redhat Enterprise Server

Python-LDAP + Redhat = Gnashing of Teeth Recently, I spent a few hours tearing my hair (or what's left of it) out attempting to install python-ldap (via pip) onto a Redhat Enterprise server. Here's the error message that I would get (look…
eikonomega
  • 1,971
  • 17
  • 28
9
votes
3 answers

How do I install python_ldap on 64 bit windows 7?

I'm using python 2.7.6 and in my code I have a line: import psycopg2.extensions which I've installed using pip. Next, my editor tells me, that psycopg2 requires python_ldap=2.4.19. However, in the PyPI repository, there's only a 32 bit version,…
Faragó Dávid
  • 103
  • 1
  • 1
  • 4
9
votes
1 answer

How to install python-ldap on a python 2.7 virtualenv on windows without compiling

I am using Windows as my main python 2.7 development environment and I want to install python-ldap on a virtual environment. The python-ldap package needs compiling :( and of course I can't compile it in my environment. So I tried finding binaries…
Serafeim
  • 14,962
  • 14
  • 91
  • 133
1
2 3
16 17