LdapClient
Overview
LdapClient is a general purpose class for querying a remote Ldap server. It can connect to any server that implements the Ldap protocol, login and search the records the server is authorized to show.
Location
-
Reference:
- RemObjects.InternetPack.dll .NET, .NET Core 5.0, .NET Standard 2.0
- RemObjects.InternetPack.fx Island
- libRemObjects.InternetPack.fx Toffee
- Namespace: RemObjects.InternetPack.Ldap
-
Ancestry:
- Component | Client | LdapClient .NET, .NET Core 5.0, .NET Standard 2.0
- Component | Client | LdapClient Island, Toffee
- Component | Client | LdapClient .NET, .NET Core 5.0, .NET Standard 2.0
constructor
Constructor for the Ldap client class.
constructor
LdapClient()
init()
Sub New()
AllAttributes
A constant to pass to the Search API when the server should return all records.
const AllAttributes: String = '*'
const String AllAttributes = "*"
static let AllAttributes: String = "*"
Const AllAttributes As String = "*"
Bind virtual
Bind is used to login, this overload let's you override the DN and password used to login.
method Bind
void Bind()
func Bind()
Sub Bind()
method Bind(dn: String; password: String; digestType: DigestType)
void Bind(String dn, String password, DigestType digestType)
func Bind(_ dn: String, _ password: String, _ digestType: DigestType)
Sub Bind(dn As String, password As String, digestType As DigestType)
Parameters:
- dn:
- password:
- digestType:
BindDigest virtual
BindDigest is used to define what authentication method is used. Currently only "None" is supported, which uses plain text authentication. Using StartTLS is recommended.
property BindDigest: DigestType read write;
DigestType BindDigest { get; set; }
var BindDigest: DigestType { get{} set{} }
Property BindDigest() As DigestType
BindDN virtual
BindDN is the distinguished name used to login (bind) to the Ldap server. A DN is an Ldap identifier like: uid=user,ou=users,dc=company,dc=com.
property BindDN: String read write;
String BindDN { get; set; }
var BindDN: String { get{} set{} }
Property BindDN() As String
Binding virtual (declared in Client)
Obsolete - Please use BindingV4 and BindingV6 instead.
property Binding: Binding read;
Binding Binding { get; }
var Binding: Binding { get{} }
ReadOnly Property Binding() As Binding
BindingV4 virtual (declared in Client)
Gets the binding which provides properties and methods such as address family, IPv4 address, port number etc for client to connect to the host network.
property BindingV4: Binding read;
Binding BindingV4 { get; }
var BindingV4: Binding { get{} }
ReadOnly Property BindingV4() As Binding
BindingV6 virtual (declared in Client)
Gets the binding which provides properties and methods such as address family, IPv6 address, port number etc for client to connect to the host network.
property BindingV6: Binding read;
Binding BindingV6 { get; }
var BindingV6: Binding { get{} }
ReadOnly Property BindingV6() As Binding
BindPassword virtual
BindPassword is the password used to login (bind) to the server.
property BindPassword: String read write;
String BindPassword { get; set; }
var BindPassword: String { get{} set{} }
Property BindPassword() As String
Close virtual
Logs out and disconnects.
method Close
void Close()
func Close()
Sub Close()
Connect virtual (declared in Client)
method Connect: Connection
Connection Connect()
func Connect() -> Connection
Function Connect() As Connection
Connect (IPAddress, Int32): Connection virtual (declared in Client)
method Connect(host: IPAddress; port: Int32): Connection
Connection Connect(IPAddress host, Int32 port)
func Connect(_ host: IPAddress, _ port: Int32) -> Connection
Function Connect(host As IPAddress, port As Int32) As Connection
Parameters:
- host:
- port:
Connect (String, Int32): Connection virtual (declared in Client)
method Connect(hostname: String; port: Int32): Connection
Connection Connect(String hostname, Int32 port)
func Connect(_ hostname: String, _ port: Int32) -> Connection
Function Connect(hostname As String, port As Int32) As Connection
Parameters:
- hostname:
- port:
Connect (IPAddress, Int32, Binding): Connection virtual (declared in Client)
Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).
class method Connect(host: IPAddress; port: Int32; binding: Binding): Connection
static Connection Connect(IPAddress host, Int32 port, Binding binding)
static func Connect(_ host: IPAddress, _ port: Int32, _ binding: Binding) -> Connection
Shared Function Connect(host As IPAddress, port As Int32, binding As Binding) As Connection
Parameters:
- host:
- port:
- binding:
Connect (String, Int32, Binding): Connection virtual (declared in Client)
Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).
class method Connect(hostname: String; port: Int32; binding: Binding): Connection
static Connection Connect(String hostname, Int32 port, Binding binding)
static func Connect(_ hostname: String, _ port: Int32, _ binding: Binding) -> Connection
Shared Function Connect(hostname As String, port As Int32, binding As Binding) As Connection
Parameters:
- hostname:
- port:
- binding:
Connected virtual
True when there is an active server connection.
property Connected: Boolean read;
Boolean Connected { get; }
var Connected: Boolean { get{} }
ReadOnly Property Connected() As Boolean
ConnectionClass (declared in Client) .NET, .NET Core 5.0, .NET Standard 2.0
Use the ConnectionClass property to specify an alternative Connection class to be used for out coming data connections. The class described by the assigned Type must be a descendant of Connection, and will be used for all connections that are established after the property has been set. Existing connections are not affected by changing the property.
If ConnectionType is null (default), instances of the Connection base class will be used.
property ConnectionClass: Type read write;
Type ConnectionClass { get; set; }
var ConnectionClass: Type { get{} set{} }
Property ConnectionClass() As Type
ConnectionFactory virtual (declared in Client)
Represents an interface for a connection.
property ConnectionFactory: IConnectionFactory read write;
IConnectionFactory ConnectionFactory { get; set; }
var ConnectionFactory: IConnectionFactory { get{} set{} }
Property ConnectionFactory() As IConnectionFactory
ConnectionPool protected virtual (declared in Client)
property ConnectionPool: ConnectionPool read write;
ConnectionPool ConnectionPool { get; set; }
var ConnectionPool: ConnectionPool { get{} set{} }
Property ConnectionPool() As ConnectionPool
ConnectNew virtual (declared in Client)
method ConnectNew: Connection
Connection ConnectNew()
func ConnectNew() -> Connection
Function ConnectNew() As Connection
ConnectNew (IPAddress, Int32): Connection virtual (declared in Client)
Overloaded. Opens and returns new connection with specified IP address and port.
method ConnectNew(host: IPAddress; port: Int32): Connection
Connection ConnectNew(IPAddress host, Int32 port)
func ConnectNew(_ host: IPAddress, _ port: Int32) -> Connection
Function ConnectNew(host As IPAddress, port As Int32) As Connection
Parameters:
- host:
- port:
ConnectNew (String, Int32): Connection virtual (declared in Client)
method ConnectNew(hostname: String; port: Int32): Connection
Connection ConnectNew(String hostname, Int32 port)
func ConnectNew(_ hostname: String, _ port: Int32) -> Connection
Function ConnectNew(hostname As String, port As Int32) As Connection
Parameters:
- hostname:
- port:
CurrentConnection virtual
Returns the current connection instance.
property CurrentConnection: Connection read;
Connection CurrentConnection { get; }
var CurrentConnection: Connection { get{} }
ReadOnly Property CurrentConnection() As Connection
Dispose protected virtual (declared in Component) Island, Toffee
method Dispose(disposing: Boolean)
void Dispose(Boolean disposing)
func Dispose(_ disposing: Boolean)
Sub Dispose(disposing As Boolean)
Parameters:
- disposing:
DnsResolveType virtual (declared in Client)
Determines if the specified HostName should be look up only Once per application run (if you establish multiple connections to the server, the subsequent connections will use the cached IPAddress) or Always, for each connect (the Hostname will be resolved again for each subsequet connect).
You'll usually only change this setting off the defaut (Once) if you anticipate the IPAddress of the target host to change frequently.
// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(DnsResolveType.Once)]
property DnsResolveType: DnsResolveType read write;
// Island
property DnsResolveType: DnsResolveType read write;
// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(DnsResolveType.Once)]
DnsResolveType DnsResolveType { get; set; }
// Island
DnsResolveType DnsResolveType { get; set; }
// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(DnsResolveType.Once)
var DnsResolveType: DnsResolveType { get{} set{} }
// Island, Toffee
var DnsResolveType: DnsResolveType { get{} set{} }
// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(DnsResolveType.Once)>
Property DnsResolveType() As DnsResolveType
// Island
Property DnsResolveType() As DnsResolveType
EnableNagle virtual (declared in Client)
Set its value to true to enable the Nagle algorithm for send coalescing.
// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(false)]
property EnableNagle: Boolean read write;
// Island
property EnableNagle: Boolean read write;
// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(false)]
Boolean EnableNagle { get; set; }
// Island
Boolean EnableNagle { get; set; }
// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(false)
var EnableNagle: Boolean { get{} set{} }
// Island, Toffee
var EnableNagle: Boolean { get{} set{} }
// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(false)>
Property EnableNagle() As Boolean
// Island
Property EnableNagle() As Boolean
Escape virtual
Escapes a string so it can be used as a value for an Ldap search filter.
class method Escape(s: String): String
static String Escape(String s)
static func Escape(_ s: String) -> String
Shared Function Escape(s As String) As String
Parameters:
- s: the string to escape
GetConnection protected virtual (declared in Client)
method GetConnection(host: IPAddress; port: Int32): Connection
Connection GetConnection(IPAddress host, Int32 port)
func GetConnection(_ host: IPAddress, _ port: Int32) -> Connection
Function GetConnection(host As IPAddress, port As Int32) As Connection
Parameters:
- host:
- port:
HostAddress virtual (declared in Client)
Gets or sets an Internet Protocol (IP) address.
property HostAddress: IPAddress read write;
IPAddress HostAddress { get; set; }
var HostAddress: IPAddress { get{} set{} }
Property HostAddress() As IPAddress
HostName virtual (declared in Client)
The server host name or IP address that you intend the client to connect to.
property HostName: String read write;
String HostName { get; set; }
var HostName: String { get{} set{} }
Property HostName() As String
LdapPort
Contains 389, the default port for Ldap.
const LdapPort: Int32 = 389
const Int32 LdapPort = 389
static let LdapPort: Int32 = 389
Const LdapPort As Int32 = 389
LdapSPort
Contains 636, the default port for Ldap wrapped with Ssl.
const LdapSPort: Int32 = 636
const Int32 LdapSPort = 636
static let LdapSPort: Int32 = 636
Const LdapSPort As Int32 = 636
LdapVersion virtual
Contains the Ldap version to use to login. Generally, you want to keep this on 3.
property LdapVersion: Int32 read write;
Int32 LdapVersion { get; set; }
var LdapVersion: Int32 { get{} set{} }
Property LdapVersion() As Int32
LoggedIn virtual
True if a Bind call succeeded.
property LoggedIn: Boolean read;
Boolean LoggedIn { get; }
var LoggedIn: Boolean { get{} }
ReadOnly Property LoggedIn() As Boolean
NewConnection protected virtual (declared in Client)
method NewConnection(binding: Binding): Connection
Connection NewConnection(Binding binding)
func NewConnection(_ binding: Binding) -> Connection
Function NewConnection(binding As Binding) As Connection
Parameters:
- binding:
NoAttributes
Contains the string to pass to Search when the server should return no attributes.
const NoAttributes: String = '1.1'
const String NoAttributes = "1.1"
static let NoAttributes: String = "1.1"
Const NoAttributes As String = "1.1"
OnResolvedHostName (declared in Client)
This event is fired after the hostname has been successfully resolved.
event OnResolvedHostName: OnResolvedHostNameEventHandler
delegate: method OnResolvedHostName(sender: Object; e: OnResolvedHostNameEventArgs)
delegate OnResolvedHostNameEventHandler OnResolvedHostName()
delegate: void OnResolvedHostName(Object sender, OnResolvedHostNameEventArgs e)
__event OnResolvedHostNameEventHandler: OnResolvedHostName!
delegate: func OnResolvedHostName(_ sender: Object, _ e: OnResolvedHostNameEventArgs)
Event OnResolvedHostName As OnResolvedHostNameEventHandler
delegate: Sub OnResolvedHostName(sender As Object, e As OnResolvedHostNameEventArgs)
OnResolveHostName (declared in Client)
This event is fired before the Client attepts to resolve the sepcifed HostName to an IP address. It provides you with an option to perform the resolution yourself, obtain the IP address from an internal cache you're maintaing, or do some other processing (such as for example chaging the hostname to look up).
event OnResolveHostName: OnResolveHostNameEventHandler
delegate: method OnResolveHostName(sender: Object; e: OnResolveHostNameEventArgs)
delegate OnResolveHostNameEventHandler OnResolveHostName()
delegate: void OnResolveHostName(Object sender, OnResolveHostNameEventArgs e)
__event OnResolveHostNameEventHandler: OnResolveHostName!
delegate: func OnResolveHostName(_ sender: Object, _ e: OnResolveHostNameEventArgs)
Event OnResolveHostName As OnResolveHostNameEventHandler
delegate: Sub OnResolveHostName(sender As Object, e As OnResolveHostNameEventArgs)
Open virtual
Connects and initializes TLS if necessary.
method Open
void Open()
func Open()
Sub Open()
Port virtual (declared in Client)
The server Port that you intend the client to connect to.
property Port: Int32 read write;
Int32 Port { get; set; }
var Port: Int32 { get{} set{} }
Property Port() As Int32
ReleaseConnection protected virtual (declared in Client)
method ReleaseConnection(connection: Connection)
void ReleaseConnection(Connection connection)
func ReleaseConnection(_ connection: Connection)
Sub ReleaseConnection(connection As Connection)
Parameters:
- connection:
ResolveHostName protected virtual (declared in Client)
method ResolveHostName
void ResolveHostName()
func ResolveHostName()
Sub ResolveHostName()
ResolveHostNameIfNeeded protected virtual (declared in Client)
method ResolveHostNameIfNeeded
void ResolveHostNameIfNeeded()
func ResolveHostNameIfNeeded()
Sub ResolveHostNameIfNeeded()
Search virtual
Executes a search on the Ldap server. The parameters passed define where to search and what to return.
method Search(baseObject: String; scope: SearchScope; aliases: AliasDereferencing; size: Int32; time: Int32; typesOnly: Boolean; filter: String; attributes: array of String): LdapSearchResults
LdapSearchResults Search(String baseObject, SearchScope scope, AliasDereferencing aliases, Int32 size, Int32 time, Boolean typesOnly, String filter, String[] attributes)
func Search(_ baseObject: String, _ scope: SearchScope, _ aliases: AliasDereferencing, _ size: Int32, _ time: Int32, _ typesOnly: Boolean, _ filter: String, _ attributes: String...) -> LdapSearchResults
Function Search(baseObject As String, scope As SearchScope, aliases As AliasDereferencing, size As Int32, time As Int32, typesOnly As Boolean, filter As String, attributes As String()) As LdapSearchResults
Parameters:
- baseObject: The base distinguished name to start searching from
- scope: The depth to execute this search query on
- aliases: Indicates if aliases should be dereferenced and up to what level
- size: The maximum number of items to return, or 0 if no client side maximum has to be enforced
- time: The maximum number of seconds to spend searching for a record, or 0 if no client side limit has to be enforced
- typesOnly: When true, only the attribute names (descriptions) are returned, not their value
- filter: Filter in rfc 1960 format. If none is passed it will use "(objectClass=*)" which will return any object
- attributes: Attributes to search for. Pass AllAttributes to return all attributes, or NoAttributes to return none
TriggerOnResolvedHostName protected virtual (declared in Client)
method TriggerOnResolvedHostName(e: OnResolvedHostNameEventArgs)
void TriggerOnResolvedHostName(OnResolvedHostNameEventArgs e)
func TriggerOnResolvedHostName(_ e: OnResolvedHostNameEventArgs)
Sub TriggerOnResolvedHostName(e As OnResolvedHostNameEventArgs)
Parameters:
- e:
TriggerOnResolveHostName protected virtual (declared in Client)
method TriggerOnResolveHostName(e: OnResolveHostNameEventArgs)
void TriggerOnResolveHostName(OnResolveHostNameEventArgs e)
func TriggerOnResolveHostName(_ e: OnResolveHostNameEventArgs)
Sub TriggerOnResolveHostName(e As OnResolveHostNameEventArgs)
Parameters:
- e:
Unbind virtual
Logs out.
method Unbind
void Unbind()
func Unbind()
Sub Unbind()
AllAttributes
A constant to pass to the Search API when the server should return all records.
const AllAttributes: String = '*'
const String AllAttributes = "*"
static let AllAttributes: String = "*"
Const AllAttributes As String = "*"
LdapPort
Contains 389, the default port for Ldap.
const LdapPort: Int32 = 389
const Int32 LdapPort = 389
static let LdapPort: Int32 = 389
Const LdapPort As Int32 = 389
LdapSPort
Contains 636, the default port for Ldap wrapped with Ssl.
const LdapSPort: Int32 = 636
const Int32 LdapSPort = 636
static let LdapSPort: Int32 = 636
Const LdapSPort As Int32 = 636
NoAttributes
Contains the string to pass to Search when the server should return no attributes.
const NoAttributes: String = '1.1'
const String NoAttributes = "1.1"
static let NoAttributes: String = "1.1"
Const NoAttributes As String = "1.1"
BindDigest virtual
BindDigest is used to define what authentication method is used. Currently only "None" is supported, which uses plain text authentication. Using StartTLS is recommended.
property BindDigest: DigestType read write;
DigestType BindDigest { get; set; }
var BindDigest: DigestType { get{} set{} }
Property BindDigest() As DigestType
BindDN virtual
BindDN is the distinguished name used to login (bind) to the Ldap server. A DN is an Ldap identifier like: uid=user,ou=users,dc=company,dc=com.
property BindDN: String read write;
String BindDN { get; set; }
var BindDN: String { get{} set{} }
Property BindDN() As String
Binding virtual (declared in Client)
Obsolete - Please use BindingV4 and BindingV6 instead.
property Binding: Binding read;
Binding Binding { get; }
var Binding: Binding { get{} }
ReadOnly Property Binding() As Binding
BindingV4 virtual (declared in Client)
Gets the binding which provides properties and methods such as address family, IPv4 address, port number etc for client to connect to the host network.
property BindingV4: Binding read;
Binding BindingV4 { get; }
var BindingV4: Binding { get{} }
ReadOnly Property BindingV4() As Binding
BindingV6 virtual (declared in Client)
Gets the binding which provides properties and methods such as address family, IPv6 address, port number etc for client to connect to the host network.
property BindingV6: Binding read;
Binding BindingV6 { get; }
var BindingV6: Binding { get{} }
ReadOnly Property BindingV6() As Binding
BindPassword virtual
BindPassword is the password used to login (bind) to the server.
property BindPassword: String read write;
String BindPassword { get; set; }
var BindPassword: String { get{} set{} }
Property BindPassword() As String
Connected virtual
True when there is an active server connection.
property Connected: Boolean read;
Boolean Connected { get; }
var Connected: Boolean { get{} }
ReadOnly Property Connected() As Boolean
ConnectionClass (declared in Client) .NET, .NET Core 5.0, .NET Standard 2.0
Use the ConnectionClass property to specify an alternative Connection class to be used for out coming data connections. The class described by the assigned Type must be a descendant of Connection, and will be used for all connections that are established after the property has been set. Existing connections are not affected by changing the property.
If ConnectionType is null (default), instances of the Connection base class will be used.
property ConnectionClass: Type read write;
Type ConnectionClass { get; set; }
var ConnectionClass: Type { get{} set{} }
Property ConnectionClass() As Type
ConnectionFactory virtual (declared in Client)
Represents an interface for a connection.
property ConnectionFactory: IConnectionFactory read write;
IConnectionFactory ConnectionFactory { get; set; }
var ConnectionFactory: IConnectionFactory { get{} set{} }
Property ConnectionFactory() As IConnectionFactory
ConnectionPool protected virtual (declared in Client)
property ConnectionPool: ConnectionPool read write;
ConnectionPool ConnectionPool { get; set; }
var ConnectionPool: ConnectionPool { get{} set{} }
Property ConnectionPool() As ConnectionPool
CurrentConnection virtual
Returns the current connection instance.
property CurrentConnection: Connection read;
Connection CurrentConnection { get; }
var CurrentConnection: Connection { get{} }
ReadOnly Property CurrentConnection() As Connection
DnsResolveType virtual (declared in Client)
Determines if the specified HostName should be look up only Once per application run (if you establish multiple connections to the server, the subsequent connections will use the cached IPAddress) or Always, for each connect (the Hostname will be resolved again for each subsequet connect).
You'll usually only change this setting off the defaut (Once) if you anticipate the IPAddress of the target host to change frequently.
// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(DnsResolveType.Once)]
property DnsResolveType: DnsResolveType read write;
// Island
property DnsResolveType: DnsResolveType read write;
// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(DnsResolveType.Once)]
DnsResolveType DnsResolveType { get; set; }
// Island
DnsResolveType DnsResolveType { get; set; }
// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(DnsResolveType.Once)
var DnsResolveType: DnsResolveType { get{} set{} }
// Island, Toffee
var DnsResolveType: DnsResolveType { get{} set{} }
// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(DnsResolveType.Once)>
Property DnsResolveType() As DnsResolveType
// Island
Property DnsResolveType() As DnsResolveType
EnableNagle virtual (declared in Client)
Set its value to true to enable the Nagle algorithm for send coalescing.
// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(false)]
property EnableNagle: Boolean read write;
// Island
property EnableNagle: Boolean read write;
// .NET, .NET Core 5.0, .NET Standard 2.0
[DefaultValue(false)]
Boolean EnableNagle { get; set; }
// Island
Boolean EnableNagle { get; set; }
// .NET, .NET Core 5.0, .NET Standard 2.0
@DefaultValue(false)
var EnableNagle: Boolean { get{} set{} }
// Island, Toffee
var EnableNagle: Boolean { get{} set{} }
// .NET, .NET Core 5.0, .NET Standard 2.0
<DefaultValue(false)>
Property EnableNagle() As Boolean
// Island
Property EnableNagle() As Boolean
HostAddress virtual (declared in Client)
Gets or sets an Internet Protocol (IP) address.
property HostAddress: IPAddress read write;
IPAddress HostAddress { get; set; }
var HostAddress: IPAddress { get{} set{} }
Property HostAddress() As IPAddress
HostName virtual (declared in Client)
The server host name or IP address that you intend the client to connect to.
property HostName: String read write;
String HostName { get; set; }
var HostName: String { get{} set{} }
Property HostName() As String
LdapVersion virtual
Contains the Ldap version to use to login. Generally, you want to keep this on 3.
property LdapVersion: Int32 read write;
Int32 LdapVersion { get; set; }
var LdapVersion: Int32 { get{} set{} }
Property LdapVersion() As Int32
LoggedIn virtual
True if a Bind call succeeded.
property LoggedIn: Boolean read;
Boolean LoggedIn { get; }
var LoggedIn: Boolean { get{} }
ReadOnly Property LoggedIn() As Boolean
Port virtual (declared in Client)
The server Port that you intend the client to connect to.
property Port: Int32 read write;
Int32 Port { get; set; }
var Port: Int32 { get{} set{} }
Property Port() As Int32
Connect (IPAddress, Int32, Binding): Connection virtual (declared in Client)
Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).
class method Connect(host: IPAddress; port: Int32; binding: Binding): Connection
static Connection Connect(IPAddress host, Int32 port, Binding binding)
static func Connect(_ host: IPAddress, _ port: Int32, _ binding: Binding) -> Connection
Shared Function Connect(host As IPAddress, port As Int32, binding As Binding) As Connection
Parameters:
- host:
- port:
- binding:
Connect (String, Int32, Binding): Connection virtual (declared in Client)
Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).
class method Connect(hostname: String; port: Int32; binding: Binding): Connection
static Connection Connect(String hostname, Int32 port, Binding binding)
static func Connect(_ hostname: String, _ port: Int32, _ binding: Binding) -> Connection
Shared Function Connect(hostname As String, port As Int32, binding As Binding) As Connection
Parameters:
- hostname:
- port:
- binding:
Escape virtual
Escapes a string so it can be used as a value for an Ldap search filter.
class method Escape(s: String): String
static String Escape(String s)
static func Escape(_ s: String) -> String
Shared Function Escape(s As String) As String
Parameters:
- s: the string to escape
constructor
Constructor for the Ldap client class.
constructor
LdapClient()
init()
Sub New()
Bind virtual
Bind is used to login, this overload let's you override the DN and password used to login.
method Bind
void Bind()
func Bind()
Sub Bind()
method Bind(dn: String; password: String; digestType: DigestType)
void Bind(String dn, String password, DigestType digestType)
func Bind(_ dn: String, _ password: String, _ digestType: DigestType)
Sub Bind(dn As String, password As String, digestType As DigestType)
Parameters:
- dn:
- password:
- digestType:
Close virtual
Logs out and disconnects.
method Close
void Close()
func Close()
Sub Close()
Connect virtual (declared in Client)
method Connect: Connection
Connection Connect()
func Connect() -> Connection
Function Connect() As Connection
Connect (IPAddress, Int32): Connection virtual (declared in Client)
method Connect(host: IPAddress; port: Int32): Connection
Connection Connect(IPAddress host, Int32 port)
func Connect(_ host: IPAddress, _ port: Int32) -> Connection
Function Connect(host As IPAddress, port As Int32) As Connection
Parameters:
- host:
- port:
Connect (String, Int32): Connection virtual (declared in Client)
method Connect(hostname: String; port: Int32): Connection
Connection Connect(String hostname, Int32 port)
func Connect(_ hostname: String, _ port: Int32) -> Connection
Function Connect(hostname As String, port As Int32) As Connection
Parameters:
- hostname:
- port:
ConnectNew virtual (declared in Client)
method ConnectNew: Connection
Connection ConnectNew()
func ConnectNew() -> Connection
Function ConnectNew() As Connection
ConnectNew (IPAddress, Int32): Connection virtual (declared in Client)
Overloaded. Opens and returns new connection with specified IP address and port.
method ConnectNew(host: IPAddress; port: Int32): Connection
Connection ConnectNew(IPAddress host, Int32 port)
func ConnectNew(_ host: IPAddress, _ port: Int32) -> Connection
Function ConnectNew(host As IPAddress, port As Int32) As Connection
Parameters:
- host:
- port:
ConnectNew (String, Int32): Connection virtual (declared in Client)
method ConnectNew(hostname: String; port: Int32): Connection
Connection ConnectNew(String hostname, Int32 port)
func ConnectNew(_ hostname: String, _ port: Int32) -> Connection
Function ConnectNew(hostname As String, port As Int32) As Connection
Parameters:
- hostname:
- port:
Dispose protected virtual (declared in Component) Island, Toffee
method Dispose(disposing: Boolean)
void Dispose(Boolean disposing)
func Dispose(_ disposing: Boolean)
Sub Dispose(disposing As Boolean)
Parameters:
- disposing:
GetConnection protected virtual (declared in Client)
method GetConnection(host: IPAddress; port: Int32): Connection
Connection GetConnection(IPAddress host, Int32 port)
func GetConnection(_ host: IPAddress, _ port: Int32) -> Connection
Function GetConnection(host As IPAddress, port As Int32) As Connection
Parameters:
- host:
- port:
NewConnection protected virtual (declared in Client)
method NewConnection(binding: Binding): Connection
Connection NewConnection(Binding binding)
func NewConnection(_ binding: Binding) -> Connection
Function NewConnection(binding As Binding) As Connection
Parameters:
- binding:
Open virtual
Connects and initializes TLS if necessary.
method Open
void Open()
func Open()
Sub Open()
ReleaseConnection protected virtual (declared in Client)
method ReleaseConnection(connection: Connection)
void ReleaseConnection(Connection connection)
func ReleaseConnection(_ connection: Connection)
Sub ReleaseConnection(connection As Connection)
Parameters:
- connection:
ResolveHostName protected virtual (declared in Client)
method ResolveHostName
void ResolveHostName()
func ResolveHostName()
Sub ResolveHostName()
ResolveHostNameIfNeeded protected virtual (declared in Client)
method ResolveHostNameIfNeeded
void ResolveHostNameIfNeeded()
func ResolveHostNameIfNeeded()
Sub ResolveHostNameIfNeeded()
Search virtual
Executes a search on the Ldap server. The parameters passed define where to search and what to return.
method Search(baseObject: String; scope: SearchScope; aliases: AliasDereferencing; size: Int32; time: Int32; typesOnly: Boolean; filter: String; attributes: array of String): LdapSearchResults
LdapSearchResults Search(String baseObject, SearchScope scope, AliasDereferencing aliases, Int32 size, Int32 time, Boolean typesOnly, String filter, String[] attributes)
func Search(_ baseObject: String, _ scope: SearchScope, _ aliases: AliasDereferencing, _ size: Int32, _ time: Int32, _ typesOnly: Boolean, _ filter: String, _ attributes: String...) -> LdapSearchResults
Function Search(baseObject As String, scope As SearchScope, aliases As AliasDereferencing, size As Int32, time As Int32, typesOnly As Boolean, filter As String, attributes As String()) As LdapSearchResults
Parameters:
- baseObject: The base distinguished name to start searching from
- scope: The depth to execute this search query on
- aliases: Indicates if aliases should be dereferenced and up to what level
- size: The maximum number of items to return, or 0 if no client side maximum has to be enforced
- time: The maximum number of seconds to spend searching for a record, or 0 if no client side limit has to be enforced
- typesOnly: When true, only the attribute names (descriptions) are returned, not their value
- filter: Filter in rfc 1960 format. If none is passed it will use "(objectClass=*)" which will return any object
- attributes: Attributes to search for. Pass AllAttributes to return all attributes, or NoAttributes to return none
TriggerOnResolvedHostName protected virtual (declared in Client)
method TriggerOnResolvedHostName(e: OnResolvedHostNameEventArgs)
void TriggerOnResolvedHostName(OnResolvedHostNameEventArgs e)
func TriggerOnResolvedHostName(_ e: OnResolvedHostNameEventArgs)
Sub TriggerOnResolvedHostName(e As OnResolvedHostNameEventArgs)
Parameters:
- e:
TriggerOnResolveHostName protected virtual (declared in Client)
method TriggerOnResolveHostName(e: OnResolveHostNameEventArgs)
void TriggerOnResolveHostName(OnResolveHostNameEventArgs e)
func TriggerOnResolveHostName(_ e: OnResolveHostNameEventArgs)
Sub TriggerOnResolveHostName(e As OnResolveHostNameEventArgs)
Parameters:
- e:
Unbind virtual
Logs out.
method Unbind
void Unbind()
func Unbind()
Sub Unbind()
OnResolvedHostName (declared in Client)
This event is fired after the hostname has been successfully resolved.
event OnResolvedHostName: OnResolvedHostNameEventHandler
delegate: method OnResolvedHostName(sender: Object; e: OnResolvedHostNameEventArgs)
delegate OnResolvedHostNameEventHandler OnResolvedHostName()
delegate: void OnResolvedHostName(Object sender, OnResolvedHostNameEventArgs e)
__event OnResolvedHostNameEventHandler: OnResolvedHostName!
delegate: func OnResolvedHostName(_ sender: Object, _ e: OnResolvedHostNameEventArgs)
Event OnResolvedHostName As OnResolvedHostNameEventHandler
delegate: Sub OnResolvedHostName(sender As Object, e As OnResolvedHostNameEventArgs)
OnResolveHostName (declared in Client)
This event is fired before the Client attepts to resolve the sepcifed HostName to an IP address. It provides you with an option to perform the resolution yourself, obtain the IP address from an internal cache you're maintaing, or do some other processing (such as for example chaging the hostname to look up).
event OnResolveHostName: OnResolveHostNameEventHandler
delegate: method OnResolveHostName(sender: Object; e: OnResolveHostNameEventArgs)
delegate OnResolveHostNameEventHandler OnResolveHostName()
delegate: void OnResolveHostName(Object sender, OnResolveHostNameEventArgs e)
__event OnResolveHostNameEventHandler: OnResolveHostName!
delegate: func OnResolveHostName(_ sender: Object, _ e: OnResolveHostNameEventArgs)
Event OnResolveHostName As OnResolveHostNameEventHandler
delegate: Sub OnResolveHostName(sender As Object, e As OnResolveHostNameEventArgs)