加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 在使用ASPNet Core的Linux上托管时的Windows身份验证

发布时间:2020-12-16 06:39:48 所属栏目:asp.Net 来源:网络整理
导读:我目前有一个自托管的Owin应用程序,它在 Windows上运行,如下所示: public class Program{ private static void Main(string[] args) { using (WebApp.StartStartup("http://localhost:9000")) { Console.WriteLine("Press Enter to quit."); Console.ReadKe
我目前有一个自托管的Owin应用程序,它在 Windows上运行,如下所示:

public class Program
{
    private static void Main(string[] args)
    {
        using (WebApp.Start<Startup>("http://localhost:9000"))
        {
            Console.WriteLine("Press Enter to quit.");
            Console.ReadKey();
        }
    }
}

public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        var listener = (HttpListener) app.Properties["System.Net.HttpListener"];
        listener.AuthenticationSchemes = AuthenticationSchemes.IntegratedWindowsAuthentication;

        app.UseNancy();
    }

当请求进入时,将使用其Windows域凭据验证用户.

对于ASPNetCore,我想知道是否有类似的设置可以使用但是应用程序在Linux上使用Kestrel Web服务器运行.

我听说Windows 2016和OpenIdConnect中间件可能有多种选择,或者我可以使用在Windows上运行的IdentityServer,但在Linux上使用应用程序,但我认为需要中间件,我也不清楚是否会有“认证舞蹈”暗示它可能不像我现在那样无缝.

任何建议和/或代码示例将不胜感激.

谢谢

解决方法

在任何平台上都没有直接支持Kestrel中的Windows auth,也没有任何可用的中间件支持Linux上的Windows身份验证.

通过Windows服务器路由登录请求是您唯一的选择. IdentityServer将是一个很好的起点. OpenIdConnect可能是您以最少的用户交互在两台服务器之间传递身份的最佳选择.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读