ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / LDAP functions
  • Overview
  • The different members of LDAPSession structure
  • Remarks
  • Example
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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.
Note To reset all variables in the LDAPSession structure with default values, use the LDAPReset function.
The different members of LDAPSession structure
The structure contains the following members:
HostCharacter string.
Address of the server:
  • server IP address 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:
  • ldapDefault: classic LDAP, without SSL support.
  • optionSSL LDAP with secure SSL connection management.
  • optionSSL + auNegotiate LDAP with secure SSL connection and:
    • 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.
Note: 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 LDAPSession structure share number: default 636
  • 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:
// Initialisation
LDAPReset()
LDAPSession.Host = "domaine.local"
LDAPSession.Port = 389
LDAPSession.Version = 3
LDAPSession.User = "user@domaine.local"
LDAPSession.Password = "mdp"
LDAPSession.Option = ldapDefaultOption
// Interrupteur permettant de choisir la connexion sécurisée SSL
IF INT_Options[1] = True THEN
	LDAPSession.Option += optionSSL
END
// Interrupteur permettant de choisir le mode "Negotiate"
IF INT_Options[2] = True
	LDAPSession.Option += auNegotiate
END

// Connexion
LDAPConnect("MaSession")
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: 03/28/2025

Send a report | Local help