我们正在使用.NET Core 3.1
并Novell.Directory.Ldap.NETStandard 3.4.0
针对 LDAP 服务器对用户进行身份验证。这是我们使用的代码:
public PasswordVerificationResult Login(string username, string password)
{
using (var connection = new LdapConnection { SecureSocketLayer = true })
{
connection.Connect("LDAP URL", 636);
connection.Bind($"COMPANY\\{username}", password);
if (connection.Bound)
{
return PasswordVerificationResult.Success;
}
}
return PasswordVerificationResult.Failed;
}
出于调试目的,我们希望查看由 Novell 库生成并发送到 LDAP 服务器(例如(&(USER=Uname)(PASSWORD=Pwd))
)的命令。我们能以某种方式记录它们吗?