|
|
|
|
|
- Overview
- The different members of LDAPSession structure
- Remarks
- Example
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: | | Host | Character string. Address of the server:- server IP address in xxx.xxx.xxx.xxx format
- Server name
| Password | Character string. Password associated with the user. Corresponds to an empty string ("") by default. | Option | Integer 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. | Port | Integer. Server port (389 by default). | User | Character 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 | Integer Version of LDAP server (2 or 3). Corresponds to 3 by default. |
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 for connecting to the server:
LDAPReset()
LDAPSession.Host = "domaine.local"
LDAPSession.Port = 389
LDAPSession.Version = 3
LDAPSession.User = "user@domaine.local"
LDAPSession.Password = "mdp"
LDAPSession.Option = ldapDefaultOption
IF INT_Options[1] = True THEN
LDAPSession.Option += optionSSL
END
IF INT_Options[2] = True
LDAPSession.Option += auNegotiate
END
LDAPConnect("MaSession")
Related Examples:
|
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, ...
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|