In its simplest form, LDAP directory services are specified in this format:
[DIRECTORY]
ldap=libsybdldap.dll ldapurl
where the ldapurl is defined as:
ldap://host:port/ditbase
The following LDAP entry, using these same attributes, is an anonymous connection and only works only if the LDAP server allows read-only access.
ldap=libsybdldap.dll ldap://test:389/dc=sybase,dc=com
You can specify a user name and password in the libtcl*.cfg file as extensions to the LDAP URL to enable password authentication at connection time.
To set the user name, enter:
if (ct_con_props(conn, CS_SET, CS_DS_PRINCIPAL, ldapprincipal,
strlen(ldapprincipal), (CS_INT *)NULL) != CS_SUCCEED)
{
...
}
To set the password, enter:
if (ct_con_props(conn, CS_SET, CS_DS_PASSWORD, ldappassword,
strlen(ldappassword), (CS_INT *)NULL) != CS_SUCCEED)
{
...
}