The LDAP Connector provides access to a variety of LDAP-based systems. The Connector supports both LDAP version 2 and 3. It is built layered on top of JNDI connectivity.
This Connector can be used in conjunction with the IBM Password Synchronization plug-ins. For more information about installing and configuring the IBM Password Synchronization plug-ins, please see the IBM TDI V7.1 Password Synchronization Plug-ins Guide.
Note that, unlike most Connectors, while inserting an object into an LDAP directory, specify the object class attribute, the $dn attribute as well as other attributes. The following code example, if inserted in the Prolog, defines an objectClass attribute that we can use later.
// This variable used to set the object class attribute var objectClass = system.newAttribute ("objectclass"); objectClass.addValue ("top"); objectClass.addValue ("person"); objectClass.addValue ("inetorgperson"); objectClass.addValue ("organizationalPerson");
Then your LDAP Connectors can have an attribute called objectclass with the following assignment:
ret.value = objectClass
To see what kind of attributes the person class has, see http://java.sun.com/products/jndi/tutorial/ldap/schema/object.html
You see that supply an sn and cn attribute in your Update or Add Connector.
In the LDAP Connector, you also need the $dn attribute that corresponds to the distinguished name. When building $dn in the Attribute Map, assuming an attribute in the work object called iuid, you typically have code like the following fragment:
var tuid = work.getString("iuid"); ret.value = "uid= " + tuid + ",ou=people,o=example_name.com";
Notes:
Some changelog connectors (the IDS
Changelog Connector, Sun Directory Change
Detection Connector and zOS Changelog
Connector) can detect modrdn operations as the underlying
LDAP servers' changelogs provide it. When this happens the Changelog
Connector tags the Entry with the modify operation. The changelog
attributes contain the "newrdn" attribute when the operation is modrdn.
The LDAP Connector detects in its modEntry method if the "newrdn"
attribute exists and if so, it replaces the rdn in the target $dn
with the new value and does a context rename operation.
LDAP
configurations in Delta mode before TDI v7.0 have treated modrdn
operation as generic and have not handled it at all. Now they will
handle it as modify. Also, such configurations will rename
$dn if the "newrdn" attribute is provided.
The Connector needs the following parameters; not all parameters
are available or visible in all modes:
The button marked "..." to the right of the Search Filter field presents a Link Criteria
dialog where we can fill out a link criteria form and generate the
LDAP search filter.
Use the Add button
to add more rows to build your selection criteria. The Match Any checkbox will generate an OR
expression rather than the default AND expression. Note that this
is a one-way helper. Anything you already have in the configuration
will be replaced by the generated expression.
Increases the strain on the server.
Not all directory servers support all SASL mechanisms and
in some cases do not have them enabled by default. Check the documentation
and configuration options for the directory server you are connecting
to for this information.
An AssemblyLine can have one list of binary attributes
only. If we have several LDAP Connectors in an AssemblyLine, the
last Connector must define the list of binary attributes for all the
LDAP Connectors in this AssemblyLine if we need to change this from
the default.
Used for adding or updating a user's password in Active Directory using LDAP. When checked, it maps the LDAP password (a conn attribute
that must be called userPassword) to another
name (unicodePwd). unicodePwd has
a special format that the Connector translates into.
Not needed for ADAM.
This increases the
strain on the server.
If this checkbox is checked, the LDAP
Connector sets the constraint DirContext.ADD_ATTRIBUTE.
If this checkbox is not checked, the LDAP Connector sets the constraint DirContext.REPLACE_ATTRIBUTE.
By setting
the DirContext.ADD_ATTRIBUTE constraint for
the LDAP connection, you add new values to any attribute that goes
through the AssemblyLine. This might mean that the same value gets
repeatedly added to the entry if not used carefully. This might also
result in an exception if the attribute in question is single-valued.
If DirContext.REPLACE_ATTRIBUTE is set, the
behavior is the same as the old LDAP Connector (default behavior), that is, all values for the attribute are replaced by whatever might
be in the work entry.
In
order to use the Virtual List View Control in TDI 7.1, the JNDI/LDAP
Booster Pack from Sun Microsystems needs to be downloaded (http://java.sun.com/products/jndi/downloads/index.html).
After downloading the Booster Pack the "ldapbp.jar" contained in the
pack needs to be copied to the TDI_install_dir\jars folder
before starting TDI. If the Virtual List View control is used, but
the "ldapbp.jar" is unavailable, the AssemblyLine will fail with a
corresponding error message.
Some servers return the whole search result in one go (for example, non paged search) and this typically causes memory problems. It might
look to you that IBM TDI leaks memory, but that is just because it
is processing the entries from the server while the server continues
to pour more and more entries into it.
LDAP servers such as Active Directory support the Paged
Search extension that enables you to retrieve a page (the number
of objects to return at a time), and this is the preferred way to
handle big return sets (see the Page Size parameter
for more info on this). We can always test if a server supports the
paged search by clicking the button to the right of the Page
Size parameter in the LDAP Connector Configuration tab.
If the Page Size parameter is not supported, you might have a problem, since there is little a client can do when
being overwhelmed by the Server. Here are some workarounds:
The Connector has implemented logic for reconnect processing as
of TDI v6.1.1 fixpack 2. The Connector-specific built-in
rules makes it possible to perform a reconnect if javax.naming.ServiceUnavailableException is
thrown regardless of the message.
In versions of TDI before v7.1, the Connector had a loop that
tried 10 times to establish the initial connection. This was to work
around a problem with some servers, but it had the side effect that
a failure to establish the initial connection could take a very long
time if the server was down. In v7.1, this "loop" is moved
into reconnect rules instead. This way you may specify if a reconnect
attempt should take place, and also how many times it should be tried.
For backwards compatibility, initial reconnection is enabled.
When using the LDAP Connector for searches against an SDBM backend
on z/OS, we need to consider the following:
Here a "presence" filter is used
in the Iterator Connector's configuration (Config Tab-> Search Filter)
to determine the scope of DN to retrieve and an subsequent equivalence
filter is used in the Link Criteria in an LDAP connector in Lookup
mode.
This section describes some of the methods available in
the LDAP Connector. The exhaustive API reference is in the JavaDocs;
they can be viewed by choosing Help -> Welcome screen, JavaDocs link
in the Config Editor.
where
If the value is equal, true is returned.
If the value is not equal, the value false is
returned. For example, if we wanted to determine if the userpassword
attribute for cn=joe,o=ibm was equal to secret, use the method: compare("cn=joe,o=ibm", "userpassword", "secret").
This method adds a given value to an attribute:
where
For example, if we want to add cn=bob to
the members attribute of cn=mygroup, use the method: addAttributeValue("cn=mygroup", "members", "cn=bob")
A java.langException is thrown when the underlying modify operation
fails.
This method replaces a given value for an attribute:
where
For example, if we want to replace the members attribute
of cn=mygroup with only cn=bob, use the method: replaceAttributeValue("cn=mygroup", "members", "cn=bob")
A java.langException is thrown when the underlying modify operation
fails.
This method removes a given value from an attribute:
where
For example, if we want to remove the value cn=bob from
the attribute members in the DN cn=mygroup, use the method: removeAttributeValue("cn=mygroup", "members", "cn=bob")
A java.langException is thrown when the underlying modify operation
fails.
This method removes all values for a given attribute:
where
For example, if we want to remove all values of the members attribute of cn=mygroup, use the method: removeAllAttributeValues("cn=mygroup", "members")
A java.langException is thrown when the underlying modify operation
fails.
In the LDAP Connector Config Editor there is a checkbox named Add Attributes (instead of replace). This option
changes the default behavior of the LDAP Connector when it modifies
an entry.
If this checkbox is checked, the LDAP Connector sets the constraint DirContext.ADD_ATTRIBUTE.
If this checkbox is not checked, the LDAP Connector sets the constraint DirContext.REPLACE_ATTRIBUTE.
By setting DirContext.ADD_ATTRIBUTE constraint for the
LDAP connection, you add new values to any attribute that goes through
the AssemblyLine. This might mean that the same value gets repeatedly
added to the entry if not used carefully. This might also result in
an exception if the attribute in question is single-valued. If DirContext.REPLACE_ATTRIBUTE is
set, the behavior is the same as the old LDAP Connector (default behavior), that is, all values for the attribute are replaced by whatever might
be in the work entry.
You typically want this flag set when you are handling groups.
If we want to add a member (a value) to a group (an attribute), we do not want to delete
all the other values.
The old behavior was to replace the attribute with the new value.
This behavior remains the default.
This property can be set at any time while the Connector
is running by setting the property addAttribute from the
scripts. Use something similar to the following command:
This property does not affect the behavior of the addAttributeValue and replaceAttributeValue methods
described previously.
The LDAP Connector has a rebind() method which facilitates
building advanced solutions like virtual directories and other solutions
that map incoming authentication requests (use any of the support
protocols) to LDAP. See the JavaDocs for more information.
The LDAP Connector supports the Skip
Lookup general option in Update or Delete mode. When it is selected, no search is performed prior to actual update and delete operations.
It requires a $dn parameter to be specified in order to operate properly.
JNDI Connector,
Configuration
The default value is subtree.
java.naming.security.authentication:DIGEST-MD5
For
more information on SASL authentication and parameters see: http://java.sun.com/products/jndi/tutorial/ldap/security/sasl.html.
Virtual List View Control
Handling memory problems in the LDAP Connector
Built-in rules for reconnect functionality
Searching against an SDBM backend on z/OS
The lookup may get the following error on these user profiles: 'ICH30001I
UNABLE TO LOCATE USER' or 'ICH31005I NO ENTRIES MEET SEARCH
CRITERIA'. This happens because these users are not real users
and therefore should not be the subject of searches. The SDBM backend
will do a "listuser" under the covers that issues the request in uppercase
and therefore, will not find the profiles. This is expected behavior.LDAP Connector methods (API)
LDAP compare
public boolean compare(String compdn, String attname, String attvalue)
throws Exception
Adding a value to an attribute
public void addAttributeValue(String moddn, String modattr, String modval)
throws Exception
Replacing an attribute value
public void replaceAttributeValue(String moddn, String modattr, String modval)
throws Exception
Removing an attribute value
public void removeAttributeValue(String moddn, String modattr, String modval)
throws Exception
Removing all attribute values
public void removeAllAttributeValues(String moddn, String modattr)
throws Exception
Flag in Config Editor for default action for attribute add
or replace
work.setProperty("addAttribute", true)
Rebind
Skip Lookup in Update and Delete mode
See also
Active Directory Change Detection Connector,
Sun Directory Change Detection Connector,
IBM Tivoli Directory Server Changelog Connector
z/OS LDAP Changelog Connector,
Wikipedia on LDAP.