ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / LDAP functions
  • Overview
  • The different members of LDAPSession structure
  • Remarks
  • Example
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
LDAPSession structure
Overview
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.
PortInteger.
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.
VersionInteger
Version of LDAP server (2 or 3). Corresponds to 3 by default.
Remarks
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
Example for connecting to the server:
// Initialization
LDAPReset()
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
END
// Check box used to choose the "Negotiate" mode
IF CBOX_Options[2] = True
LDAPSession.Option += auNegotiate
END

// Connection
LDAPConnect("MySession")
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…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help