The problem that I have is that in my environment the password isn't kept in AD (for security reasons) but the membership provider wants to use the password to verify the user. Since this isn't needed in this environment, I have modified the code to skip the password check if the site is using the AD provider. This fix assumes that AD entries are unique since it is ignoring the password (since they would be verified against their network credentials to get their username, this shouldn't be much of an issue).
Updated for 4.3.5:
Provider.Membership.AspNetProvider
AspNetMembershipProvider.vb
~line 777 modify CreateUser:
Public Overrides Function CreateUser(ByRef user As UserInfo) As UserCreateStatus
Dim createStatus As UserCreateStatus
Dim _config As Authentication.Configuration = Authentication.Configuration.GetConfig()
Dim ProviderTypeName As String = _config.ProviderTypeName
Dim isADSIProvider As Boolean = (ProviderTypeName.IndexOf("Authentication.ADSIProvider") >= 0)
Try
' check if username exists in database for any portal
Dim objVerifyUser As UserInfo = GetUserByUserName(Null.NullInteger, user.Username, False)
If Not objVerifyUser Is Nothing Then
If objVerifyUser.IsSuperUser Then
' the username belongs to an existing super user
createStatus = UserCreateStatus.UserAlreadyRegistered
Else
' the username exists so we should now verify the password
If isADSIProvider Or ValidateUser(objVerifyUser.PortalID, user.Username, user.Membership.Password) Then
' check if user exists for the portal specified
objVerifyUser = GetUserByUserName(user.PortalID, user.Username, False)
If Not objVerifyUser Is Nothing Then
.....