简体   繁体   English

使用Novell.Directory.Ldap.NETStandard2_0的受限用户(登录工作站)在ASP.NET Core中的LDAP身份验证问题

[英]LDAP authentication problem in ASP.NET Core for restricted users (logon workstations) using Novell.Directory.Ldap.NETStandard2_0

I use Novell.Directory.Ldap.NETStandard2_0 package to authenticate users from Active Directory and it works fine for most of users. 我使用Novell.Directory.Ldap.NETStandard2_0程序包从Active Directory中对用户进行身份验证,它对大多数用户都适用。

using (var cn = new LdapConnection())
{
    cn.Connect(ldapOptions.Host, ldapOptions.Port);
    var userDn = username.IndexOf('@') < 0 ? username + $"@{ldapOptions.Domain}" : username;
    cn.Bind(userDn, password);
    if (cn.Bound)
    {
        result.Result = AuthResult.Succeed;
        result.Message = "Login Successful using LDAP: {0}.";
    }

    return result;
}

The problem is when we need to authenticate users that are restricted to logon to only certain computers in our domain (Active Directory). 问题是当我们需要验证仅限于登录到我们域(Active Directory)中的某些计算机的用户时。

I added the computer that host my application (IIS & Win Server 2016) to the list but it still fails and restricted users cannot be authenticated yet. 我将承载我的应用程序(IIS&Win Server 2016)的计算机添加到列表中,但它仍然失败,并且无法对受限用户进行身份验证。

How can I solve this issue? 我该如何解决这个问题? should I change my code? 我应该更改我的代码吗? or Active Directory/IIS settings? 或Active Directory / IIS设置?

LDAP身份验证通常来自域控制器,因此配置为LDAP主机的域控制器需要出现在登录工作站(userWorkstations)列表中。

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

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