Questions tagged [ldap]

Lightweight Directory Access Protocol (LDAP), is an application protocol for accessing and maintaining distributed directory information services over an IP network.

The Lightweight Directory Access Protocol is an application protocol for accessing distributed directory services that act in accordance with X.500 data and service models over an IP network. Access is via unsecured TCP/IP, TLS or SSL. LDAP is a binary protocol described in terms of ASN.1 and transmitted using ASN.1 Basic Encoding Rules (BER).

A directory is a hierarchical collection of records known as a Directory Information Base, or when visualized, as a Directory Information Tree. The directory model should be visualized as an upside-down tree, much like a UNIX file-system. The root of the Directory Information Tree is known as the prefix or namingContext. The namingContext, supported versions of the protocol, supported features and supported controls (operation semantics modifiers) and other information can be discovered by querying the root DSE, though the information might be protected by access controls.

Clients (Directory User Agents) issue requests to the directory server (Directory System Agent) and the directory server returns an appropriate response, which could be success (which might include requested entries from the Directory Information Tree in the case of a search), or an indication of success or failure of a search, add, modify, delete, moddn (rename) or extended operation. Controls might be used to alter the semantics of a request, for example, a sort control might be included with a search request to sort the returned entries (known as a server-side sort). Without the inclusion of the sort control in the search request, entries returned from search operations are not ordered, and must not be ordered. Clients must not expect that entries are ordered in any way.

Modern directory servers support a high-speed replication mechanism which is not defined by the standard, though there have been some attempts at defining a replication standard. Therefore, replication and the protocol used for replication is vendor-specific. If data must be synchronized between directory servers from different vendors, a synchronization device must be used.

Most modern programming languages have an LDAP SDK, including Java, PHP, Perl, C/C++, and others. Directory Server software usually comes equipped with a set of command line tools such as ldapsearch, ldapmodify, and others.

Directory Information Trees accessed by the LDAP protocol are used in authentication and authorization applications, configuration storage, profile storage, public-key infrastructure and other applications requiring:

  • speed of access
  • a small, light-weight protocol
  • A simple programming model
  • easily configured replication, redundancy, and failover

Questions that are specific to Active Directory should not be tagged with the LDAP tag unless the question is specifically related to the LDAP protocol or the Directory Information Model. Active Directory provides an LDAP interface, but that interface, while LDAP version 3 compatible, does not fully implement the LDAP standard, and deviates from it in important ways. Therefore, there are questions that can be answered that are specific to Active Directory that are not applicable to standards-compliant LDAP servers and vice versa. Correctly tagging a questions will result in a higher probability of an accurate, timely response.

11627 questions
31
votes
5 answers

LDAP query in python

I want to execute the following query in the ldap ldapsearch -h hostname -b dc=ernet,dc=in -x "(&(uid=w2lame)(objectClass=posixAccount))" gidnumber ldapsearch -h hostname -b dc=ernet,dc=in -x "(&(gidNumber=1234)(objectClass=posixGroup))" cn And use…
w2lame
  • 2,774
  • 6
  • 35
  • 48
31
votes
5 answers

Using AD as authentication for Django

I'm working on a Django-based application in a corporate environment and would like to use the existing Active Directory system for authentication of users (so they don't get yet another login/password combo). I would also like to continue to use…
Technical Bard
  • 4,395
  • 7
  • 31
  • 32
31
votes
5 answers

How to check a username/password combination?

Using LDAP is checking a username/password as simple as attempting to bind as that user and noting the results, or is there a special LDAP "check password" function? I'm trying to get a bit more "behind the scenes" understanding while working on a…
DrStalker
  • 9,061
  • 17
  • 43
  • 47
31
votes
3 answers

How to enable LDAP with PHP 7.0 in Ubuntu server?

I have recently upgraded Ubuntu to version 16.04 and PHP to version 7. However, the ldap connection is not working. How to enable ldap in PHP 7?
Wings2fly
  • 887
  • 1
  • 11
  • 31
31
votes
2 answers

Using active directory to authenticate users on intranet site

I have an 'intranet' site that I have built, which has a login system of its own (users register as new users, and use the username/password thereon to login to the site). However, now I want to extend it, and have the intranet site use the existing…
kallakafar
  • 725
  • 3
  • 11
  • 27
30
votes
1 answer

Ldap filter for attribute that may not exist

I have a problem with adding filter for attribute, which exist not in all members of organization unit. I set filter like this^ (status=Active) But this property doesn't exist in half of members and server returns "unwilling to execute 53…
Johnny_D
  • 4,592
  • 3
  • 33
  • 63
29
votes
2 answers

Active Directory vs OpenLDAP

What are the main diffrences between these two implementations of LDAP protocol? Which is better for heterogenous environment? Any good websites about this topic?
Migol
  • 8,161
  • 8
  • 47
  • 69
29
votes
6 answers

Reasons to store users' data in LDAP instead of RDBMS

It is often said that using LDAP is a good way to store data about users. That's beacause users' "directory" is hierarchical and it changes rarely. But in my opinion that doesn't exclude using RDBMS. What might be reasons to use LDAP? I guess that…
szymond
  • 1,311
  • 2
  • 19
  • 41
29
votes
2 answers

LDAP server which is my base dn

Hello I'm trying to use my ldap test server in order to authenticate users in openca. I'm currently connecting through phpldapadmin with : Login DN : cn=admin,dc=example,dc=com Password : mypass but on openca something is going wrong... in…
invader7
  • 452
  • 1
  • 5
  • 11
29
votes
2 answers

Using C# to authenticate user against LDAP

I'm using DirectorySearcher to search for a user entry in LDAP server. DirectoryEntry de = new DirectoryEntry(); de.Path = "LDAP://myserver/OU=People,O=mycompany"; de.AuthenticationType = AuthenticationTypes.None; DirectorySearcher deSearch = new…
sunny days
  • 837
  • 1
  • 13
  • 26
28
votes
7 answers

Active Directory LDAP Query by sAMAccountName and Domain

How do you do a query of an LDAP store by sAMAccountName and Domain? What is the "domain" property named in Active Directory or LDAP terms? This is what I have for the filter so far. I'd like to be able to add in the…
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466
28
votes
4 answers

.Net's Directory Services throws a strange exception

I have a small C# solution used to check users credentials. It works fine for two of my teammates, but on my PC I get an exception. The relevant code: PrincipalContext context = new PrincipalContext(ContextType.Domain); if…
Noich
  • 14,631
  • 15
  • 62
  • 90
27
votes
6 answers

How to setup admin user with gitlab with LDAP authentication?

I've just setup gitlab, but I'm completely lost with regards to admin user. The wiki seems silent about this topic, and google hasn't been of help either. So, how do I setup admin users with gitlab on LDAP authentication?
Daniel C. Sobral
  • 295,120
  • 86
  • 501
  • 681
26
votes
6 answers

Listing All Active Directory Groups

The following code lists some, but not all, Active Directory Groups. Why? I am trying to list all security groups, distribution groups, computer groups etc. Have I specified the wrong objectClass? private static void ListGroups() { …
cymorg
  • 437
  • 1
  • 8
  • 15
26
votes
2 answers

Can PostgreSQL have a uniqueness constraint on array elements?

I'm trying to come up with a PostgreSQL schema for host data that's currently in an LDAP store. Part of that data is the list of hostnames a machine can have, and that attribute is generally the key that most people use to find the host records. One…