我正在网站上管理ldap。我陷入了一种情况,当我尝试通过帐户锁定或禁用它来验证用户失败时。 我想要做的是首先验证用户显示消息后,该帐户被锁定或禁用。Ldap用户身份验证不适用于锁定或禁用的帐户
我编码这样
LdapConnection connection = new LdapConnection(new LdapDirectoryIdentifier("SJTPNOC.com", 636));
connection.SessionOptions.VerifyServerCertificate = new VerifyServerCertificateCallback((con, cer) => true);
connection.SessionOptions.ProtocolVersion = 3;
connection.AuthType = AuthType.Basic;
connection.SessionOptions.SecureSocketLayer = true;
connection.Timeout = new TimeSpan(0, 0, 10);
connection.Credential = new NetworkCredential(username, password);
using (connection){
connection.Bind();
}
显示错误? –
感谢但是有什么样的错误? –
像你想要做的是清楚然而,当运行与上述代码的ur应用程序是它给任何一种错误?我现在不能运行我们的代码,因为我不在我的桌子上 –