答案 0 :(得分:2)
最好的方法是使用Windows authentication。但是,只有在运行该服务器的服务器已加入域(或受信任域)的情况下,这才起作用。
如果没有,那么您将必须使用Forms Authentication,用户输入用户名和密码,然后通过LDAP针对代码中的AD进行身份验证。 .NET Core中有两种方法可以做到这一点:
Microsoft.Windows.Compatibility
NuGet程序包。Novell.Directory.Ldap.NETStandard
。this question上有两个答案,描述了如何实施两种解决方案。