AD LDS ValidateCredentials gives false after enabling Password Policy

1.2k Views Asked by At

I am using AD LDS to authenticate user. There is one issue I am facing with.

I have the following code to authenticate a user:

PrincipalContext context = new PrincipalContext(ContextType.ApplicationDirectory,xxxx, xxxx, ContextOptions.SimpleBind);
auth = context.ValidateCredentials(userId, CryptoHelper.Decrypt(password), ContextOptions.SimpleBind);

When the password policy from Local Security Policy is disabled the auth returns true, however when I enable it, it returns false.

Also, the auth returns false only for users which are created after enabling the password policy.

1

There are 1 best solutions below

0
On

Found the issue, when we enable the password policy the msDS-UserAccountDisabled is set to TRUE when we create an user. So in the process of creating the user if we set it to false it will work.