System.Web.Security.ActiveDirectoryMembershipProvider.ValidateUser Method

Verifies that the specified user name and password exist in the Active Directory data store.

Syntax

public override bool ValidateUser (string username, string password)

Parameters

username
The name of the user to validate.
password
The password for the specified user.

Returns

true if the specified username and password are valid; otherwise, false. If the user specified does not exist in the Active Directory data store, the ActiveDirectoryMembershipProvider.ValidateUser(string, string) method returns false.

Remarks

This method is called by the System.Web.Security.Membership class to validate user credentials against the Active Directory data store.

If the ActiveDirectoryMembershipProvider.EnablePasswordReset property is true and the supplied credentials are valid, the user's tracking counters for bad password answers are reset.

The ActiveDirectoryMembershipProvider.ValidateUser(string, string) method may return false when the correct credentials are supplied, under the following circumstances:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

When validating a user, the provider validates the credentials by connecting to the Active Directory data store using the specified user name and password, not the credentials configured in the application configuration file.

However, the System.Web.Security.ActiveDirectoryMembershipProvider instance will connect to the directory using the configured credentials for the following reasons.

Note:

Connecting to an Active Directory domain controller with the "Guest" account enabled is a potential security threat. All validation attempts made on an Active Directory domain controller with the "Guest" account enabled will succeed. To improve security when using an Active Directory domain controller, you should disable the "Guest" account on the domain controller.

The System.Web.Security.ActiveDirectoryMembershipProvider instance will attempt a concurrent bind against Active Directory when one of the following conditions is met:

In addition, for a concurrent bind to be made, the following conditions must be true:

When a concurrent bind is used, the last logon date for the user is not updated in the directory; therefore, the ActiveDirectoryMembershipUser.LastLoginDate property cannot be relied on.

Leading and trailing spaces are trimmed from the username parameter.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0