|
|
|
|
- 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. 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: | | Host | Character string. Address of the server:- IP address of server 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: - 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. | 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 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 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:
|
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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|