简体   繁体   English

启用密码策略后,AD LDS ValidateCredentials将返回false

[英]AD LDS ValidateCredentials gives false after enabling Password Policy

I am using AD LDS to authenticate user. 我正在使用AD LDS来验证用户身份。 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. 当禁用本地安全策略的密码策略时,auth返回true,但是当我启用它时,它返回false。

Also, the auth returns false only for users which are created after enabling the password policy. 此外,auth仅对启用密码策略后创建的用户返回false。

Found the issue, when we enable the password policy the msDS-UserAccountDisabled is set to TRUE when we create an user. 发现问题,当我们启用密码策略时,msds-UserAccountDisabled在我们创建用户时设置为TRUE。 So in the process of creating the user if we set it to false it will work. 因此,在创建用户的过程中,如果我们将其设置为false,它将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM