Hash password before validate with LDAP

Viewed 2676

I have a web-based-tool. On the login-form, the password will hashed before sending it. All fine, the database stores only hashed passwords.

Now, we want a login with LDAP over DirectoryEntry. But the constructor only accepts plain passwords.

My question: How can I pass hashed passwords to DirectoryEntry-class?

Current method:

    public bool isAuthenticated(string domain, string username, string pwd)
    {
        string domainAndUsername = domain + @"\" + username;
        DirectoryEntry entry = new DirectoryEntry(_path, domainAndUsername, pwd);

        try
        {
            Object obj = entry.NativeObject;
            return true;
        }
        catch
        {
            return false;
        }
    }
1 Answers
Related