LDAP: Programming Practices
The summary follows below. See LDAP: Programming Practices for the full article.
Summary
- use LDAPv3
- do not use JNDI for new code
- do not use threads with Net::LDAP (Perl)
- understand and use the root DSE
- use matching rules to make attribute value comparisons and distinguished name comparisons
- use connection pooling
- use secure connections only
- use application-specific accounts
- do not rely on the order in which attributes and entries are returned
- check for controls in responses and exceptions
- use the post read request control to ‘read’ back attributes after a modification or add
- always supply a client-requested size limit and time limit
- use the authorization identity request control or who am i? extended operation to determine the authorization state of a connection
- where possible, use the password modify extended operation to change passwords
- always transmit passwords in clear-text so the server can check password quality and history
- do not rely on names or values or availability of operational attributes
- notify directory server administrators of access control requirements ahead of time
- if available, use the GetEffectiveRightsRequestControl
- use the most restricted search scope possible
- use base-level scope when a DN is known
- ensure that your application can handle referrals
- minimize or avoid vendor-specific code
- before transmitting a request control check that it is handler by the server by using the root DSE
- get information about attributes from the schema
- ensure your application can handle an unsolicited notification from the server
- understand attribute syntaxes, matching rules, and ordering rules
- avoid hard-coding distinguished names
- when using LDAP transactions, understand that the server can abort a transaction without a client having requested the abort
11 Comments
Leave a CommentTrackbacks
- Searching for a newly created object fails in AD? - Programmers Goodies
- LDAP: Using ldapmodify « Diaries, Triumphs, Failures, and Rants
- LDAP: Operation Purpose Request Control « Diaries, Triumphs, Failures, and Rants
- LDAP: Using ldapsearch « Diaries, Triumphs, Failures, and Rants
- LDAP: Matched Values Request Control « Diaries, Triumphs, Failures, and Rants
- LDAP: Change Notification Using Persistent Search « Diaries, Triumphs, Failures, and Rants
- LDAP: Using Matching Rules to Compare Attribute Values « Diaries, Triumphs, Failures, and Rants
- LDAP: In-Memory Directory Server using UnboundID LDAP SDK « Diaries, Triumphs, Failures, and Rants
- LDAP Attribute values and attributes are not ordered « Diaries, Triumphs, Failures, and Rants
- PHP: Building a New LDAP Extension « continuations

Excellent advice for people getting into LDAP programming.
The unboundid SDK is indeed the best toolkit for Java. I’ve been using it since its first public release. Very well thought out in terms of API and superbly documented.
Vladimir
Nimbus Directory Services