小编Jhe*_*ier的帖子

使用Novell.Directory.Ldap.NETStandard库的C#netcore ldap身份验证

这是我第一次使用LDAP和Active Directory。我必须使用.NetCore制作一个必须通过ActiveDirectory进行身份验证的Web api(WindowsServer 2008 r2),我正在遵循Novell.Directory.Ldap.NETStandard中的示例, 但是我不明白我必须设置参数的方式。这是我在ActiveDirectory Server中创建的用户:

https://i.stack.imgur.com/A7iGq.jpg

在Novell的样本中

if (args.Length != 5)
{
    System.Console.Out.WriteLine("Usage:   mono VerifyPassword <host name>" + " <login dn> <password> <object dn>\n" + "         <test password>");
    System.Console.Out.WriteLine("Example: mono VerifyPassword Acme.com " + "\"cn=Admin,o=Acme\" secret\n" + "         \"cn=JSmith,ou=Sales,o=Acme\" testPassword");
    System.Environment.Exit(0);
}

int ldapPort = LdapConnection.DEFAULT_PORT;
int ldapVersion = LdapConnection.Ldap_V3;
System.String ldapHost = args[0];
System.String loginDN = args[1];
System.String password = args[2];
System.String objectDN = args[3];
System.String testPassword = args[4];
LdapConnection conn = new LdapConnection();

try
{ …
Run Code Online (Sandbox Code Playgroud)

c# authentication novell active-directory .net-core

0
推荐指数
1
解决办法
7873
查看次数

标签 统计

.net-core ×1

active-directory ×1

authentication ×1

c# ×1

novell ×1