Last post Oct 20, 2006 01:57 PM by DSmay
Oct 20, 2006 01:57 PM|DSmay|LINK
I'm having an issue with a few account that fail to authenicate in our Asp.Net 2.0 web app. We have a common object used as a custom authenication that talk to AD. It works for 99% of the account but occassional it will fail consistantly on certain accounts.
I was finally able to track done to the offending line of code .RefreshAlll method of the DirectoryEntry object. No authenication type was specificed on DirectoryEntry object but under debug in watch window it looks to default to secure running under Asp.net
2.0 If I change authenication type to FastBind by uncommenting the line below it works.
The error message when using secure bind is ErrorCode: -2147016689 Message: "The directory service is unavailable."
Another interesting fact is we have another web running under 1.1 and it seems to work fine using same object. I'm wondering if DirectoryEntry defaulted to fastbind in 1.1 and now defaults to secure in 2.0?
This object live in GAC and is a pain to deploy since its on a bunch of servers so I was hoping its just something with the account in AD/schema and we could possibly fix the account instead of changing GAC object. Does anyone have any clues on what could
be causing this issue ?
_directoryEntry = New DirectoryEntry(_adsPath)
_directoryEntry.Username = _adsUsername
_directoryEntry.Password = User.Password
'_directoryEntry.AuthenticationType = AuthenticationTypes.FastBind
Authenticate = True
Me._LastError = string.Empty
User.Username = _adsUsername
User.Identifier = _adsUsername
Catch ex As COMException
' Login failed for some reason
Me._LastError = ex.Message
Authenticate = False