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
  • LDAPSession structure
  • LDAP and User Groupware
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Used to connect to an LDAP server via the characteristics defined in the LDAPSession structure. The connection is actually established during the first access (LDAPFind for example).
Example
// Vérification du couple "Login / Mot de passe" utilisateur
// Initialisation
LDAPReset()
LDAPSession.Host = "domaine.local"
LDAPSession.Port = 389
LDAPSession.Version = 3
LDAPSession.User = "user@domaine.local"
LDAPSession.Password = "mdp"
// Connexion
LDAPConnect("MaSession")

// Recherche des informations de l'utilisateur.
sDn is string = LDAPFind("MaSession", ...
		"cn=users,dc=domain,dc=local","sAMAccountName=testeur")
// Autre possibilité
// sDn est une chaîne = LDAPRecherche("MaSession", ...
// "cn=users,dc=domain,dc=local","UserPrincipalName=testeur@domain.local")

IF sDn = "" THEN
	// Impossible de lister le DN de connexion
	// Le login ne correspond pas au bon mot de passe 
	Error("Le mot de passe de l'utilisateur " + LDAPSession.User + " est erroné.") 
END
// Déconnexion 
LDAPDisconnect("MaSession")
Syntax
<Result> = LDAPConnect(<LDAP session>)
<Result>: Boolean
  • True if the connection is established,
  • False otherwise. ErrorInfo returns more details about the error.
The connection is not established if the session name already exists.
<LDAP session>: Character string
Name of LDAP session. This name must be unique. This name will be used to identify the session in all LDAP functions.
Remarks

LDAPSession structure

The LDAPSession structure is used to specify the characteristics of the LDAP session to use (server address, port, etc.). This structure must be initialized before the call to LDAPConnect.
This structure is also used to specify different options such as the management mode of SSL or the connection mode.
Note: We recommend resetting the LDAPSession structure using the LDAPReset function.

LDAP and User Groupware

You project can be automatically connected to an LDAP directory via the User Groupware.
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, ...
Component: wd300com.dll
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