System.Web
2.0.0.0
System.Web.Security.MembershipProvider
This class is used by the and classes to provide membership services for an ASP.NET application using an Active Directory (AD) or Active Directory Application Mode (ADAM) server.
Using an ADAM server requires specific configuration. For more information, see the ADAM Configuration section below.
The instance works only in the full-trust policy default configuration of ASP.NET. In order to use the instance at any partial-trust level, either you must make changes to the appropriate trust policy file for your application or you must create a "sandbox" assembly that is deployed in the GAC.
The class requires unrestricted permission to run. This permission is not added to any of the partial-trust policy files supplied with ASP.NET. Although adding the permission to a partial-trust policy file will enable use of the class, doing so makes the namespace classes available to any code running in your ASP.NET pages. This option is not recommended for any Web servers that need to run in a secure, locked-down mode.
As an alternative, you can create a "sandbox" assembly that calls the class. This assembly can contain either a wrapper class that forwards method calls to the class or a class that derives from the class. In either case, the wrapper class must assert unrestricted permission. Deploy the sandbox assembly in the GAC and mark the assembly with the (APTCA) attribute. This will enable your partially trusted ASP.NET code to call your wrapper class, and since the wrapper class internally asserts the unrestricted permission, your wrapper class will be able to successfully call the provider
You must create a connectionString entry in the Web.config file that identifies the Active Directory server, Active Directory domain, or ADAM application partition to use. The provider will only operate at domain scope, or in a subscope within a domain. The following table lists allowed connection strings and the scope used.
-
Connection string
Scope
-
LDAP://<domain or server>:[port]
Port number is optional for ADAM and not needed for Active Directory.
The provider runs against the specified domain or server. With AD, user creation and deletion is done in the default users container. All other operations, including any search methods, will be rooted at the default naming context for the domain.
If the connection string specifies an Active Directory domain rather than a specific server and the property is true, the instance will always connect to the server with the PDC role for the domain to ensure that password changes take effect and are available when the method is called.
This connection string is not allowed when using ADAM, and will throw a .
-
LDAP://<domain or server>:[port]/<container dn>
Port number is optional for ADAM and not needed for Active Directory.
The provider runs against the specified domain or server. User creation and deletion is only done in the specified container. All other operations, including any search methods, perform subtree searches rooted at the container.
For ADAM servers, the container specifies the root of an application partition, or a container within an application partition.
We recommend that the connection string define a specific container to improve performance.
The instance maps directory attributes to properties. Default attributes are used if no attribute mapping is done in the Web.config file. For more information on attribute mappings, see the individual properties in the class documentation.
The following table lists the properties and their default attribute mappings.
The class does not explicitly check that provider attributes are not mapped to core attributes of the user object in the directory. You must ensure that sensitive information from the directory is not exposed through mapped attributes.
-
Property
Default directory attribute
Can be mapped?
-
securityIdentifier
No
-
userPrincipalName
Yes, but must be either userPrincipalName or sAMAccountName
-
comment
No
-
whenCreated
No
-
mail
Yes, but must be a single-valued attribute of type Unicode String.
-
n/a
Not supported by .
-
n/a
Not supported by .
-
pwdLastSet
No
-
none
Yes, but must be a single-valued attribute of type Unicode String.
-
User-Account-Control (AD)
mDS-UserAccountDisabled (ADAM)
No
-
computed from lockoutTime and the AD lockout duration (AD on Windows 2000)
msDS-User-Account-Control-Computed (AD on Windows Server 2003)
msDS-User-Account-Control-Computed (ADAM)
No
-
If user is locked out due to too many bad password attempts, the lockout time attribute is returned.
If user is locked out due to too many bad password answer attempts, the value stored in the attribute defined by attributeMapFailedPasswordAnswerLockoutTime is returned.
If user is locked out due to both a bad password and too many bad password attempts, the most recent date/time value is returned.
If the account is not locked out, return 1/1/1754 for SQL compatibility.
No
When both the and properties are true, the class supports password-reset security by requiring the user to answer a predetermined question. To support the question and answer, you must set the following configuration attributes using the add Element for providers for membership (ASP.NET Settings Schema) in the application configuration file.
-
Configuration attribute
Attribute type
-
attributeMapPasswordQuestion
Must be a single-valued attribute of type Unicode String.
-
attributeMapPasswordAnswer
Must be a single-valued attribute of type Unicode String.
-
attributeMapFailedPasswordAnswerCount
Must be a single-valued attribute of type Integer.
-
attributeMapFailedPasswordAnswerTime
Must be a single-valued attribute of type Large Integer/Interval.
-
attributeMapFailedPasswordAnswerLockoutTime
Must be a single-valued attribute of type Large Integer/Interval.
For more information on using password-reset security, see the property.
Active Directory connections
When the class is used to connect to an Active Directory or an Active Directory Application Mode (ADAM) server, the connectionProtection attribute that is set using the add Element for providers for membership (ASP.NET Settings Schema) in the application configuration file may restrict the types of operations the class can perform over the connection. The connectionProtection attribute also determines the methods the instance will use to create the connection to the Active Directory or ADAM server.
The following table shows the effect of the connectionProtection attribute when connecting to an Active Directory.
-
connectionProtection setting
Effect
-
The class will connect to an Active Directory, with these restrictions.
-
Any method that sets a password will fail. Active Directory requires a secure connection when changing passwords.
-
You must explicitly set the connectionUsername and connectionPassword attributes using the add Element for providers for membership (ASP.NET Settings Schema) in the application configuration file; otherwise, the instance will throw a exception.
-
Secure
The class will attempt to connect to Active Directory using SSL. If SSL fails, a second attempt to connect to Active Directory using sign-and-seal will be made. If both attempts fail, the instance will throw a exception.
Both process credentials and explicit credentials are supported.
The following table shows the effect of the connectionProtection attribute when connecting to an ADAM server.
-
connectionProtection setting
Effect
-
The class will connect to an ADAM server, with this restriction.
-
Any method that sets passwords will fail unless you explicitly configure the ADAM server to allow passwords to be sent and changed over an insecure connection.
Both process credentials and explicit credentials are supported.
-
Secure
The class will attempt to connect to the ADAM server using SSL. If a connection cannot be made, the instance will throw a exception.
Both process credentials and explicit credentials are supported.
ADAM Configuration
When using an ADAM server, the ADAM instance must contain a schema that defines the User class. You can import the User class with an LDIF import of the MS-User.ldf file available in the ADAM install directory.
The class will work with an ADAM server configured to use the default network ports. The following table shows the defaults expected for the ADAM server.
-
connectionProtection setting
Expected ADAM port
-
389
-
Secure
636
If your ADAM server is not using the default ports, see article Q817583, "Active Directory Services does not request secure authorization over an SSL connection," in the Microsoft Knowledge Base.
Manages storage of membership information for an ASP.NET application in Active Directory and Active Directory Application Mode servers.
Constructor
The constructor is called by ASP.NET to create an instance of the class as specified in the configuration for the application. This constructor is not intended to be used from your code.
Creates a new instance of the class.
2.0.0.0
Property
System.String
To be added.
The property can be set to the name of the ASP.NET application; however, the application name is not used by the class.
Therefore, unlike other implementations, all ASP.NET applications that access the same Active Directory data store will always share the same user data.
The name of the application using the custom membership provider.
2.0.0.0
Method
System.Boolean
To be added.
To be added.
The method is used to update the user's password in the Active Directory data store. Regardless of the credentials that the instance is configured to use, the provider connects to the Active Directory server using the and parameters as the connection credentials.
If the property is true, the user cannot change his or her password if the account was previously locked because the user made too many attempts to answer the password question. The user will need to wait the number of minutes specified in the property before changing the password.
If the password change succeeds and the property is true, then the user's bad password answer tracking counters are reset.
The provider finds the user instance to update by performing a subtree search for the user name starting at the search point specified in the connection string. See the class topic for more information about connection strings.
To change passwords on an Active Directory server the connectionProtection attribute must be set to .
When using an ADAM server, the connectionProtection attribute can be set to , but only if you explicitly configure the ADAM server to allow password change over unsecured connections.
Changes the password for the specified user.
true if the password was updated successfully; otherwise, false.
The name of the user to update the password for.
2.0.0.0
Method
System.Boolean
To be added.
To be added.
The method is called by the class to update the password question and answer for a user in the Active Directory membership store.
Requiring a password question and answer provides an additional layer of security when resetting a user's password. When creating a user name, a user can supply a question and answer that can later be used to reset a forgotten password. The method updates the password question and answer for a membership user to new values.
In order to use the method, you must set these additional attributes in your application's configuration file:
-
requiresQuestionAndAnswer must be true.
-
attributeMapPasswordQuestion and attributeMapPasswordAnswer must be mapped to attributes in the Active Directory schema.
If the above criteria are not met, a is thrown at initialization.
The instance connects to the Active Directory data store with the credentials provided in the and parameters to validate the user name/password combination. The actual update of the question and answer is performed with the configured connection credentials of the provider.
If an incorrect password is supplied to the method, the directory server will increment the counters that track invalid password attempts. This can result in the user being locked and unable to log on until either the lock status is cleared by a call to the method or the locked duration specified in the directory passes.
If the update to the question and answer succeeds and the property is true, the user's bad password answer tracking counters are reset.
The password answer is encrypted using the method before it is stored in the Active Directory data store. The encryption key and algorithm are specified by the machineKey configuration element. The decryption attribute on the machineKey element must be specified, the class does not support auto-generated encryption keys.
The maximum length for the password question is 256 characters. The maximum length for the password answer is 128 characters.
Leading and trailing spaces are trimmed from all parameter values except for .
The provider finds the user instance to update by performing a subtree search for the user name starting at the search point specified in the connection string. See the class topic for more information about connection strings.
Updates the password question and answer for a user in the Active Directory store.
true if the update was successful; otherwise, false. A value of false is also returned if the password is incorrect, the user is locked out, or the user does not exist in the Active Directory data store.
The user to change the password question and answer for.
The password for the specified user.
2.0.0.0
Method
System.Web.Security.MembershipUser
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
2.0.0.0
Property
System.Web.Security.ActiveDirectoryConnectionProtection
To be added.
The property indicates the current level of security that the instance is configured to use. The property is based on the connnectionProtection attribute set with the add Element for providers for membership (ASP.NET Settings Schema) in the application configuration file.
The connectionProtection attribute can only be set to or in the configuration file.
See the class topic for more information about connection strings.
Gets the current level of security being used to protect communications with the server.
2.0.0.0
Method
System.Boolean
The method immediately removes the user identified by the parameter. Since the Active Directory data store does not store user information in separate areas of the directory, the parameter is ignored, although it must be set to either true or false when calling the method.
The class finds the user instance to delete by performing a single-level search for the user name in the users container determined by the connection string. See the class topic for more information about connection strings.
must be 64 characters or less.
You cannot delete users unless the credentials used to connect to the Active Directory server have either Domain Administrator rights (not recommended) or the "delete child instances" access right.
Removes a user's membership information from the Active Directory data store.
true if the user was deleted; otherwise, false if the user was not found in the data store.
The name of the user to delete.
This parameter is ignored by the method.
2.0.0.0
Property
System.Boolean
To be added.
The property indicates whether you can use the method to reset a user's password. The property is set in your application's configuration file using the enablePasswordReset attribute of the membership element.
You can only set the property true when the following membership element settings have been made.
-
requiresQuestionAndAnswer must be true.
-
The Active Directory schema must be modified to contain attributes for storing the password question and answer, as well as the three tracking fields for password-answer change attempts.
-
attributeMapPasswordQuestion, attributeMapPasswordAnswer, attributeMapFailedPasswordAnswerCount, attributeMapFailedPasswordAnswerTime, and attributeMapFailedPasswordAnswerLockoutTime must be mapped to attributes in the Active Directory schema.
If the above criteria are not met, a is thrown at initialization.
When the connection string in the application configuration file specifies an Active Directory domain rather than a specific server, the instance will always connect to the domain controller that has the PDC role for the domain to ensure that password changes take effect and are available when the method is called.
Even if the property is true, you cannot reset user passwords unless the credentials used to connect to the Active Directory server have either Domain Administrator rights (not recommended) or the "reset password" access right.
Gets a value indicating whether the instance is configured to allow users to reset their passwords.
2.0.0.0
Property
System.Boolean
To be added.
The class does not support password retrieval.
Gets a value indicating whether the user's password can be retrieved from the Active Directory data store. This property always returns false.
2.0.0.0
Property
System.Boolean
To be added.
Because searching an Active Directory server is potentially resource intensive, the property enables you to turn off search-oriented methods. The property is set in your application's configuration file using the enableSearchMethods attribute of the membership element.
When the property is false, the following methods are not available:
-
-
-
The provider uses a subtree search starting at the search point specified in the connection string. See the class topic for more information about connection strings.
We recommend that you do not enable searching on production systems until you have confirmed that the search queries issued by the class do not adversely impact your directory server's performance. Since the class is designed for a stateless Web environment, it is unable to use the paging optimizations exposed by the underlying APIs. This means that paging operations during searches against large directories are very expensive and should be avoided. Search operations are always issued against the directory server configured in the connection string, or an automatically selected server in the case of a connection string pointing at a domain. The provider does not use a global catalog for its search methods.
Gets a value indicating whether search-oriented methods are available.
2.0.0.0
Method
System.Web.Security.MembershipUserCollection
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
2.0.0.0
Method
System.Web.Security.MembershipUserCollection
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
2.0.0.0
Method
System.String
The method of the class calls the method of the class to retrieve a random password. The password length is set to the value of the property. The password length can never be less than 14.
You can specifically call the method by referencing the class directly from the Provider property of the class.
The generated password only contains alphanumeric characters and the following punctuation marks: !@#$%^&*()_-+=[{]};:<>|./?. No hidden or non-printable control characters are included in the generated password.
The generated password will contain at least the number of non-alphanumeric characters specified in the property. The generated password will not be tested with the regular expression in the property.
The class does not generate passwords that match complexity requirements set in the directory. It is possible to generate a random password that fails the password complexity rules set by the directory.
Generates a random password.
A random password.
2.0.0.0
Method
System.Web.Security.MembershipUserCollection
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
2.0.0.0
Method
System.Int32
The class does not support returning the number of users online.
Throws a exception in all cases.
A in all cases.
2.0.0.0
Method
System.String
To be added.
The class does not support returning the user's password.
Returns the password of the specified user from the database. The class does not support this method.
Always throws a exception.
The user to retrieve the password for.
2.0.0.0
Method
System.Web.Security.MembershipUser
The method is called by the class to retrieve information on the specified user from the Active Directory data store.
The search looks for a user instance where the objectSID attribute matches the parameter.
The provider uses a subtree search starting at the search point specified in the connection string. See the class topic for more information about connection strings.
Gets the membership user information associated with the specified user key.
A instance representing the user specified. If no user is found in the Active Directory data store for the specified value, null is returned.
The unique identifier for the user.
The method ignores this parameter.
2.0.0.0
Method
System.Web.Security.MembershipUser
The method is called by the class to retrieve information on the specified user from the Active Directory data store.
The provider uses a subtree search starting at the search point specified in the connection string. See the class topic for more information about connection strings.
Leading and trailing spaces are trimmed from the parameter value.
Gets the membership user information associated with the specified user name.
A instance representing the user specified. If no user is found in the Active Directory data store for the specified value, null is returned.
The name of the user to get information for.
The method ignores this parameter.
2.0.0.0
Method
System.String
This method is called by the class to retrieve a user name from the Active Directory data store based on the e-mail address for the user.
If more than one user in the membership data store has the same e-mail address, the first user name encountered is returned. You can set the requiresUniqueEmail attribute of the membership element to true in the application configuration file to ensure that each e-mail address in the database is unique.
Leading and trailing spaces are trimmed from the parameter value. If the e-mail address is empty after trimming, an is thrown. If the e-mail address is null, all user names in the Active Directory data store are searched, and the first user name is returned.
We recommend that you do not enable searching on production systems until you have confirmed that the search queries issued by the class do not adversely impact your directory server's performance.
The method will run even when the property is false.
Since the class is designed for a stateless Web environment, it is unable to use the paging optimizations exposed by the underlying APIs. This means that paging operations during searches against large directories are very expensive and should be avoided. Search operations are always issued against the directory server configured in the connection string, or an automatically selected server in the case of a connection string pointing at a domain. The provider does not use a global catalog for its search methods.
The provider uses a subtree search starting at the search point specified in the connection string. See the class topic for more information about connection strings.
Gets the user name associated with the specified e-mail address.
The user name associated with the specified e-mail address.
The e-mail address to search for.
2.0.0.0
Method
System.Void
This method initializes the object with the property values specified in the ASP.NET application configuration file (Web.config) and is not intended to be used directly from your code.
Initializes the instance with the property values from the application's configuration files. This method is not intended to be called from your code.
The name of the instance to initialize.
A containing the names and values of the configuration options for the membership provider.
2.0.0.0
Property
System.Int32
To be added.
When the property is true, the user must answer the password question to reset his or her password. The user is allowed a limited number of answer attempts within the time window established by the property. If the number of password answer attempts is greater than or equal to the value stored in the property, the user is locked out of further attempts for the number of minutes stored in the property.
This property does not control the number of failed logon attempts a user can make before being locked out. The Active Directory server handles failed logon attempts and is not affected by the value of this property.
The property is set in your application's configuration file using the maxInvalidPasswordAttempts attribute of the membership element. If the property is not set in the application's configuration file, the property is set to the default value of 5.
Gets the number of failed answer attempts a user is allowed for the password-reset question.
2.0.0.0
Property
System.Int32
To be added.
The property returns the minimum number of special, non-alphanumeric characters that must be entered to create a valid password.
The property value is set in the application configuration using the minRequiredNonalphanumericCharacters attribute of the membership configuration element.
A non-alphanumeric character is a character for which the method returns false.
Gets the minimum number of special characters that must be present in a valid password.
2.0.0.0
Property
System.Int32
To be added.
The property gets the minimum number of characters that must be entered to create a valid password.
The property value is set in the application configuration using the minRequiredPasswordLength attribute of the membership configuration element.
Gets the minimum length required for a password.
2.0.0.0
Property
System.Int32
To be added.
When the property is true, the user must answer the password question to reset his or her password. If the user fails to supply the correct answer a consecutive number of times equal to the property value within the observation time period specified by the property, the user is locked out of further attempts for the number of minutes contained in the property.
This property does not set the duration a user is locked out after failing to enter a valid password. The Active Directory server handles failed logon attempts and is not affected by the value of this property. We recommend that the property be set to the same value as the account lockout duration specified for too many failed logon attempts in the Active Directory configuration. This will present consistent auto-lockout behavior for users regardless of whether they were locked out due to failed logon attempts or to bad password answers.
The property is set in your application's configuration file using the passwordAnswerAttemptLockoutDuration attribute of the membership element. If the property is not set in the application's configuration file, the property is set to the default value of 30 minutes.
Get the length of time for which a user account is locked out after the user makes too many bad password-answer attempts.
2.0.0.0
Property
System.Int32
To be added.
The property works in conjunction with the property to help guard against an unwanted source guessing the password or password answer of a membership user through repeated attempts. When users are attempting to log in, change their password, or reset their password, only a certain number of consecutive attempts are allowed within a specified time window. The length of the time window is specified by the property, which identifies the number of minutes allowed between invalid attempts. If the number of consecutive failed attempts a user makes to reset his or her password equals the value stored in the property, and the time elapsed since the last invalid attempt is less than the number of minutes specified for the property, then the user account s locked out for the number of minutes contained in the property. If the interval between the current failed attempt and the last failed attempt is greater than the property setting, the current invalid attempt is counted as the first attempt. If a valid password answer is supplied before the maximum number of allowed invalid attempts is reached, the count of invalid password-answer attempts is set to zero. If a valid password is supplied before the maximum number of allowed invalid attempts is reached, the count of invalid password attempts and the count of invalid password-answer attempts are set to zero.
We recommend that the property be set to the same value as the account lockout duration that is specified for the maximum number of failed logon attempts in the Active Directory configuration. This will present consistent auto-lockout behavior for users whether they were locked out due to failed logon attempts or to bad password answers.
The property is set in your application's configuration file using the passwordAttemptWindow attribute of the membership element. If the property is not set in the application's configuration file, the property is set to the default value of 10 minutes.
Gets the time window during which consecutive failed attempts to provide a valid password or a valid password answer are tracked.
2.0.0.0
Property
System.Web.Security.MembershipPasswordFormat
To be added.
The property does not support password retrieval. The behavior of the object is the same as other providers working with Hashed passwords.
Gets a value indicating the format of passwords in the Active Directory data store.
2.0.0.0
Property
System.String
To be added.
The property gets the regular expression used to evaluate password complexity.
The property is not used to validate auto-generated passwords in the method.
The property is set in the application configuration using the passwordStrengthRegularExpression attribute of the membership configuration element.
Gets the regular expression used to evaluate a password.
2.0.0.0
Property
System.Boolean
To be added.
The property is set in your application's configuration file using the requiresQuestionAndAnswer attribute of the membership element. If the property is not set in the application's configuration file, the property is set to the default value of false.
When the requiresQuestionAndAnswer attribute is set to true, you must also set these additional attributes.
-
attributeMapPasswordQuestion and attributeMapPasswordAnswer must be mapped to attributes in the Active Directory schema.
If the above criteria are not met, a is thrown at initialization.
You can require a password question and answer when creating a user, but set the property to false to prevent users from changing their passwords using the class.
Gets a value indicating whether the membership provider is configured to require a password question and answer when creating a user.
2.0.0.0
Property
System.Boolean
To be added.
When the property is true, the instance ensures that the e-mail address is not used by any other user within the current scope when either the or method is called.
The property is set in your application's configuration file using the requiresUniqueEmail attribute of the membership element. If the property is not set in the application's configuration file, the property is set to the default value of false.
Gets a value indicating whether an e-mail address stored on the Active Directory server must be unique.
2.0.0.0
Method
System.String
To be added.
The method is called by the class to reset the password for a user in the Active Directory data store to a new randomly generated value. The new password is returned.
The random password created by the method is not guaranteed to pass the regular expression in the property. However, the random password will meet the criteria established by the and properties.
If an incorrect answer is supplied to the method, the internal counter that tracks invalid password-answer attempts is incremented by one. This can result in the user being unable to log on until the lock status is cleared by a call to the method. If the correct password answer is supplied and the user is not currently locked out, then the internal counter that tracks invalid password attempts is reset to zero. For more information, see the and properties.
Leading and trailing spaces are trimmed from all parameter values.
You can call the method directly by first obtaining a reference to the instance from the property.
The provider uses a subtree search starting at the search point specified in the connection string. See the class topic for more information about connection strings.
To set passwords on an Active Directory server, the connectionProtection attribute must be set to .
When using an ADAM server, the connectionProtection attribute can be set to , but only if you explicitly configure the ADAM server to allow password changes over unsecured connections.
You cannot reset passwords unless the credentials used to connect to the Active Directory server have either Domain Administrator rights (not recommended) or the "reset password" access right.
To reset a password, all of the following conditions must be true:
-
The property must be set to true.
-
The Active Directory schema must be modified to contain attributes for storing the password question and answer, and the three tracking fields for password answer changes.
-
The attributeMapPasswordQuestion, attributeMapPasswordAnswer, attributMapFailedPasswordAnswerCount, attributeMapFailedPasswordAnswerTime, and attributeMapFailedPasswordAnswerLockedTime attributes must be set in the application configuration file.
-
The property must be set to true.
-
The security context for connecting to the Active Directory data store (either the process account or the explicit credentials) must have sufficient privileges to change passwords. The credentials used to connect to the Active Directory server have either Domain Administrator rights (not recommended) or the "reset password" access right.
Security policies set on the Active Directory server may make it impossible for the method to generate a password that satisfies the policies. The default implementation of the method will generate passwords that satisfy the default password policies on domain controllers running Windows Server 2003 SP1. If the password cannot be reset due to security policies on the Active Directory server, a is thrown.
Resets a user's password to a new, automatically generated password.
The new password for the specified user.
The user to reset the password for.
2.0.0.0
Method
System.Boolean
To be added.
Users are most commonly locked out and cannot be validated by the method when the property is exceeded within the time specified in the property or when too many attempts have been made to log on using the wrong password.
If the property is true, when a user is unlocked the counters for bad passwords are reset.
The provider uses a subtree search starting at the search point specified in the connection string. See the class topic for more information about connection strings.
Leading and trailing spaces are trimmed from the parameter value.
Clears a lock so that a membership user can be validated.
true if the membership user was successfully unlocked; otherwise, false. The method also returns false when the membership user is not found in the data store.
2.0.0.0
Method
System.Void
This method is called by the class to update user information in the Active Directory data store. The , , and property values are updated for the specified membership user. All other properties are ignored.
The maximum length for the parameter is 256 characters. The maximum length for the property is 256 characters.
The password for a membership user cannot be updated using the method. To update the password for a membership user, use the method.
The provider uses a subtree search starting at the search point specified in the connection string. See the class topic for more information about connection strings.
Updates information about a user in the Active Directory data store.
A instance representing the user to update and the updated information for the user.
2.0.0.0
Method
System.Boolean
This method is called by the class to validate user credentials against the Active Directory data store.
If the property is true and the supplied credentials are valid, the user's tracking counters for bad password answers are reset.
The method may return false when the correct credentials are supplied, under the following circumstances:
-
The user account was locked out by the directory server because of too many failed logon attempts. The user will not be able to log on until the directory's lockout duration passes.
-
If the property is true, the user account will be locked if the user supplied a bad password answer too many times. The user's account will unlock after the time specified in the property has passed.
-
The user must exist in the container specified in the connection string. Valid credentials are supplied for a user account located in a different container or in a different domain. The user must exist in the container specified in the connection string.
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 instance will connect to the directory using the configured credentials for the following reasons.
-
To confirm that a user exists within the search scope as determined by the instance's connection string. The provider uses a subtree search starting at the search point specified in the connection string to determine whether a user exists. The user must exist in the specified container. Credentials that are valid outside the connection string's specified container will not be validated. See the class topic for more information about connection strings.
-
If the property is true, the instance will use the configured credentials to load the user instance to check whether the user has been locked out because he or she has made too many failed attempts to change the password answer.
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 instance will attempt a concurrent bind against Active Directory when one of the following conditions is met:
-
The property is set to .
-
The property is set to and SSL is chosen by the instance to secure the connection.
In addition, for a concurrent bind to be made, the following conditions must be true:
-
The directory server must be running on Windows Server 2003.
-
The operating system of the Web server running the instance must support concurrent binds (for example, Windows Server 2003).
When a concurrent bind is used, the last logon date for the user is not updated in the directory; therefore, the property cannot be relied on.
Leading and trailing spaces are trimmed from the parameter.
Verifies that the specified user name and password exist in the Active Directory data store.
true if the specified and are valid; otherwise, false. If the user specified does not exist in the Active Directory data store, the method returns false.
The name of the user to validate.
The password for the specified user.
2.0.0.0