ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / LDAP functions
  • LDAPSession structure
  • LDAP and User Groupware
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
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
// Check the "Login/Password" couple
// Initialization
LDAPReset()
LDAPSession.Host = "domain.local"
LDAPSession.Port = 389
LDAPSession.Version = 3
LDAPSession.User = "user@domain.local"
LDAPSession.Password = "pwd"
// Connection
LDAPConnect("MySession")
 
// Find information about the user.
sDn is string = LDAPFind("MySession", ...
"cn=users,dc=domain,dc=local","sAMAccountName=tester")
// Other possibility
// sDn is string = LDAPFind("MySession", ...
// "cn=users,dc=domain,dc=local","UserMainName=tester@domain.local")
 
IF sDn = "" THEN
// Unable to list the connection DN
// The login and the password do not match
Error("The password of the user " + LDAPSession.User + " is invalid.")
END
// Disconnection
LDAPDisconnect("MySession")
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.
Remark: It is recommended to reinitialize the LDAPSession structure with LDAPReset.

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: wd290com.dll
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