Home | Sign in | English EN
  • Overview
  • The different members of LDAPSession structure
  • Remarks
  • Example
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
LDAPSession structure
AjaxNot available
The LDAPSession structure is a preset structure of WLanguage (no declaration is required). This structure is used to define the characteristics of an LDAP session.
Remark: To reset all the variables of LDAPSession structure with the default values, use LDAPReset.
The different members of LDAPSession structure
The structure contains the following members:
HostCharacter string.
Address of the server:
  • IP address of server in xxx.xxx.xxx.xxx format
  • Server name
PasswordCharacter string.
Password associated with the user. Corresponds to an empty string ("") by default.
OptionInteger constant
Management mode of SSL:
  • ldapDefaultOption: standard LDAP, without SSL management.
  • optionSSL: LDAP with management of secure SSL connection.
  • optionSSL + auNegotiate: LDAP with management of secure SSL connection and authentication:
    • If the login is not specified, the connection login of Windows is used.
    • If the login and the password are specified, the connection is established via "Generic Security Services" (GSS) (Snego). The authentication method used is the most appropriate method found in a list of possibles authentications.
Remark: The connection mode used must be supported by the LDAP server.
Server port (389 by default).
UserCharacter string.
Authentication of the user. This string can correspond to any identification mode recognized by the server. Corresponds to an empty string ("") by default.
Version of LDAP server (2 or 3). Corresponds to 3 by default.
To establish secure LDAP connections (LDAP over SSL), you must:
  • Modify the part number of the LDAPSession structure: 636 by default
  • Install the certificate of the trusted authority that signed the server certificate on the computer from which LDAPConnect is called.
  • Use the same host name than the one of the SSL certificate installed on the server.
Example for connecting to the server:
// Initialization
LDAPSession.Host = "domain.local"
LDAPSession.Port = 389
LDAPSession.Version = 3
LDAPSession.User = "user@domain.local"
LDAPSession.Password = "pwd"
LDAPSession.Option = ldapDefaultOption
// Check box used to choose the secure SSL connection
IF CBOX_Options[1] = True THEN
LDAPSession.Option += optionSSL
// Check box used to choose the "Negotiate" mode
IF CBOX_Options[2] = True
LDAPSession.Option += auNegotiate

// Connection
Related Examples:
The LDAP functions Unit examples (WINDEV): The LDAP functions
[ + ] Using the WLanguage LDAP functions.
These functions are used to interact with the LDAP data, to view the content of any LDAP directory and to modify the LDAP data: LDAPConnect, LDAPListChildren, LDAPAdAttribute, LDAPDeleteAttributeValue, ...
See also
Minimum version required
  • Version 10
This page is also available for…
Click [Add] to post a comment