zoukankan      html  css  js  c++  java
  • IdentityServer Topics(6)- Windows身份验证

    在Windows平台上,你可以让IdentityServer使用 Windows身份验证 对用户进行身份验证。 当你使用以下类型托管运行 IdentityServer 时, Windows身份验证功能可用:

    • 使用Kestrel服务器但需要使用IIS integration或者IIS
    • 使用HTTP.sys服务器

    在这两种情况下,Windows身份认证将会触发 HttpContext 的 ChallengeAsync 方法,使用 Scheme "Windows"。快速入门:quickstart UI 的 AccountController 实现了该逻辑,

    使用Kestrel

    当使用Kestrel,在代码中使用IIS integration,且必须通过IIS来运行:

    var host = new WebHostBuilder()
        .UseKestrel()
        .UseUrls("http://localhost:5000")
        .UseContentRoot(Directory.GetCurrentDirectory())
        .UseIISIntegration()
        .UseStartup<Startup>()
        .Build();
    

    在使用WebHost.CreateDefaultBuilder方法设置WebHostBuilder时,Kestrel会自动配置。

    此外,IIS(或IIS Express)中的虚拟目录必须启用Windows和匿名身份验证。

    IIS integration 层将配置一个Windows身份验证处理程序到DI,可以通过身份验证服务调用。 通常在IdentityServer中,建议禁用此自动行为。 可以在 ConfigureServices 中完成:

    services.Configure(iis =>
    {
    iis.AuthenticationDisplayName = "Windows";
    iis.AutomaticAuthentication = false;
    });

  • 相关阅读:
    四校联考【20171001】
    C语言基础知识
    页表和TLB
    python
    Cache组织方式
    On the Spectre and Meltdown Processor Security Vulnerabilities
    latex-组织文本
    深入理解计算机系统
    深入理解计算机系统-计算机系统漫游
    逻辑地址到物理地址的转换
  • 原文地址:https://www.cnblogs.com/stulzq/p/8145288.html
Copyright © 2011-2022 走看看