HorseBarnFell
HorseBarnFell

Reputation: 11

Why am I getting an authentication error with DirectoryEntry?

A couple of our users have been getting the following error when logging into our applications:

The user name or password is incorrect.

at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_NativeObject()
at [Rest of stack trace removed for security reasons]

I've had them change their passwords, I've had them change their passwords to basic letter/number combinations, and they're not showing as locked in the active directory. Most of our users are still able to login, and I was able to log into the application via one of the affected user's computers, so I'm pretty sure it's not some kind of connection issue. They're still getting that error.

Is there any other possible cause for this error? Is there anything I should check for in Active Directory?

Rough version of code below

using System.DirectoryServices;
using Constants;

public DirectoryEntry Login(string username, string pass) 
{
    string path = Constants.Path;

    DirectoryEntry entry = new DirectoryEntry(path, username, pass);
    entry.AuthenticationType = AuthenticationTypes.Secure;

    return entry;
}

Upvotes: 0

Views: 29

Answers (0)

Related Questions