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
38
votes
4 answers

How to get the current user's Active Directory details in C#

I am working on an C# and ASP.Net application, that uses Windows Authentication. i.e. in Web.config: I want to get details for the current user (full name, email address, etc) from…
Sophia
  • 5,643
  • 9
  • 38
  • 43
38
votes
6 answers

LDAP filter for blank (empty) attribute

I have searched on this topic, but all I find are filters that return entries where a certain attribute is not present, like: (!(manager=*)) However, I want to find entries where the attribute is present, but has a null value (i.e. an empty/blank…
mydoghasworms
  • 18,233
  • 11
  • 61
  • 95
37
votes
6 answers

LDAP root query syntax to search more than one specific OU

I need to run a single LDAP query that will search through two specific organization units (OU) in the root query however I'm having a tough go of it. I've tried the following queries below and neither were…
James
  • 12,636
  • 12
  • 67
  • 104
36
votes
4 answers

Authenticating user using LDAP from PHP

My project is to make a module enrollment system for our university. So I contacted the IT people in my university for details to authenticate the students into the system. We are developing the system using the existing university login. They gave…
John
35
votes
3 answers

How can I find out which server hosts LDAP on my windows domain?

I am trying develop an application (C#) to query an LDAP server. I don't know the actual server named to query - is there a way to find out using standard windows tools or something in .net? I've also heard rumors that having the server name…
bugfixr
  • 7,997
  • 18
  • 91
  • 144
35
votes
3 answers

Querying an LDAP

I haven't worked with an LDAP before so I am a bit lost. I need to connect to an LDAP source find a specific attribute and change it. The input for the program is a CSV file with a list of users. The program is supposed to read the UID from the CSV…
Graeme
  • 351
  • 1
  • 3
  • 3
34
votes
1 answer

How to PHP ldap_search() to get user OU if I don't know the OU for base DN

I have an Active-Directory structure where User objects reside in OU for example, IT, Technical, HR, Accounts etc.. I want to write a PHP script that authenticates the user with AD and depending on their Group to provide the aproperiate web…
Jake
  • 11,273
  • 21
  • 90
  • 147
34
votes
4 answers

Active Directory - Check username / password

I'm using the following code on Windows Vista Ultimate SP1 to query our active directory server to check the user name and password of a user on a domain. public Object IsAuthenticated() { String domainAndUsername = strDomain + "\\" + strUser; …
Michael G
  • 6,695
  • 2
  • 41
  • 59
34
votes
4 answers

Configuring Tomcat to authenticate using Windows Active Directory

What is the best way to configure Tomcat 5.5 or later to authenticate users from Windows Active Directory?
santtu
  • 341
  • 1
  • 3
  • 3
33
votes
4 answers

using wildcards in LDAP search filters/queries

I have very limited knowledge in AD and LDAP queries so I have a simple question on how to use wildcards. Supposed there is object with a displayName of "ITSM - Problem Management" My current implementation of the filter with a wildcard is as…
AnimaSola
  • 7,146
  • 14
  • 43
  • 62
33
votes
3 answers

Is LDAP DN case insensitive?

I build some feature that assumes that LDAP DN is case insensitive. I have checked it with ActiveDirectory, Oracle and OpenLDAP and it is case insensitive. Is it correct for all LDAPs?
Michael
  • 10,063
  • 18
  • 65
  • 104
33
votes
6 answers

Installing py-ldap on Mac OS X Mavericks (missing sasl.h)

I can't seem to be able to get the python ldap module installed on my OS X Mavericks 10.9.1 machine. Kernel details: uname -a Darwin 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64 I…
gprx100
  • 370
  • 1
  • 4
  • 13
32
votes
3 answers

How to connect with Java into Active Directory

I am using Weblogic, Ejb3.0. Java 1.6 I need to access Active Directory via Java code. I read about several ways (Kerberos, LDAP) Anyone could advice me on comfortable way of doing so? where could I have some full code examples, thanks, ray.
rayman
  • 20,786
  • 45
  • 148
  • 246
32
votes
8 answers

How do you authenticate against an Active Directory server using Spring Security?

I'm writing a Spring web application that requires users to login. My company has an Active Directory server that I'd like to make use of for this purpose. However, I'm having trouble using Spring Security to connect to the server. I'm using…
Michael
  • 34,873
  • 17
  • 75
  • 109
32
votes
3 answers

How do a LDAP search/authenticate against this LDAP in Java

I am playing with LDAP and Java search. Here's my LDIF export with a simple organization version: 1 dn: dc=example,dc=com objectClass: organization objectClass: dcObject objectClass: top dc: example o: MyOrganization description: Test…
Satish
  • 6,457
  • 8
  • 43
  • 63