Example: mldap_logon_exListing Directory Vuser Functions (MLDAP)

Logs onto an LDAP server for a specific session.

int mldap_logon_ex( MLDAP *pldap, char *transaction, char *url, [<List of Attributes>,] LAST );
pldapA session identifier for an LDAP session.
transactionA transaction name for this step. To instruct VuGen not to create a transaction for this step, use a NULL string, "".
URLThe URL of the LDAP server, including the server name: "URL=ldap path"The LDAP path should have the following format:
List of AttributesOptional: A comma-separated list of attributes. See the list below. Each argument is a quoted key-value pair, for example, "KeyName=Value".
LAST A marker indicating the end of the argument list.

The mldap_logon_ex function logs onto an LDAP server for a specific session.

This function is for use with multiple sessions. For global or single sessions, use the mldap_logon function, which leaves out the session identifier.

Possible attribute arguments:

Argument Description
Mode=<mode> The LDAP call mode. Either Sync or Async
Timeout=<seconds> The LDAP search timeout.
Version=<n> The LDAP protocol version. For example,1,2,or 3.
SSLCertDir=<path> The path to the SSL certificates database file (cert8.db). The SSLCertDir parameter is required if an SSL connection is going to be established.
SSLKeysDir=<path> The path to the SSL keys database file (key3.db)
SSLKeyNickname=<nickname> The SSL key nickname in keys database file
SSLKeyCertNickname=<nickname> The SSL key's certificate nickname in the certificates database file
SSLKeysPassword=<password>The SSL key's password
SSLSecModule=<path> The path to the SSL security module file (secmod.db)
StartTLS Passing StartTLS specifies that the StartTLS extension's specific command must be issued to switch the connection to TLS(SSL) mode.
If StartTLS is used, then the URL parameter can be empty (URL=ldaps://). That means that TLS will be established on the existing session (pldap) without reconnecting to the server. This is equivalent to calling mldap_set_option with TLS=ON.

Examples of different URLs:

URL Effect
ldap:// Connects to the server (port 389) then binds with username usr_name , password pwd.
ldap:// Connects to server (default unsecured port 389) then binds anonymously : username = NULL, password = NULL.
ldaps:// Connects to server (default secured port 636) then binds with username usr_name, password "".
ldap:// Connects to server, skips bind.
ldap:// Connects to server, skips bind.
ldap://usr_name:pwd@ Binds on existing session with username usr_name, password pwd, without reconnecting.
ldap://:@ Binds anonymously on existing session with username = NULL, password = NULL, without reconnecting.
ldap://" Not allowed.

Return Values

If this function succeeds, it returns E_OK. Otherwise, it returns a negative value.


No parameterization is available for this function.