LdapConnection.Bind Method

Definition

Sends an LDAP bind.

Overloads

Bind(NetworkCredential)

The Bind(NetworkCredential) method sends an LDAP bind using the specified NetworkCredential.

Bind()

The Bind() method sends an LDAP bind using the current credentials.

Bind(NetworkCredential)

Source:
LdapConnection.cs
Source:
LdapConnection.cs
Source:
LdapConnection.cs

The Bind(NetworkCredential) method sends an LDAP bind using the specified NetworkCredential.

C#
public void Bind(System.Net.NetworkCredential newCredential);

Parameters

newCredential
NetworkCredential

A NetworkCredential object that specifies the credentials to use.

Exceptions

The object handle is not valid.

The error code returned by LDAP does not map to a ResultCode enumeration error code.

Either the ClientCertificates property specifies more than one client certificate to send for authentication, or the AuthType property is Anonymous and one or more credentials are supplied.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

Bind()

Source:
LdapConnection.cs
Source:
LdapConnection.cs
Source:
LdapConnection.cs

The Bind() method sends an LDAP bind using the current credentials.

C#
public void Bind();

Exceptions

The object handle is not valid.

The error code returned by LDAP does not map to one of the ResultCode enumeration error codes.

Either the ClientCertificates property specifies more than one client certificate to send for authentication, or the AuthType property is Anonymous and one or more credentials are supplied.

Remarks

Binding is the step where the LDAP server authenticates the client and, if the client is successfully authenticated, allows the client access to the LDAP server based on that client's privileges. If a connection was created using ldap_connect, and if no binding function is called, on a LDAP v3 server, you run as anonymous.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)