Linux 上的 ASP.NET Core Windows 身份验证 [英] ASP.NET Core Windows Authentication on Linux
问题描述
我在 Linux 容器中运行 ASP.NET Core Web 应用程序.我需要为我的应用程序提供 Windows 身份验证.如何实施?
I run ASP.NET Core web application in a Linux container. I need to provide Windows authentication for my application. How can this be implemented?
我认为可以使用可以通过 Kerberos 进行身份验证的反向代理服务器来解决该问题.
I assume that the problem can be solved using a reverse proxy server that can authenticate via Kerberos.
推荐答案
从 ASP.NET Core 3.0 开始,现在可以通过添加 Microsoft.AspNetCore.Authentication.Negotiate NuGet 包,并在您的 Startup.ConfigureServices
中使用它方法:
Starting with ASP.NET Core 3.0, it is now possible to use Windows Authentication on Linux and MacOS by adding the Microsoft.AspNetCore.Authentication.Negotiate NuGet package, and using this in your Startup.ConfigureServices
method:
services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
.AddNegotiate();
这在Startup.Configure
中:
app.UseAuthentication();
以及 文档.
这篇关于Linux 上的 ASP.NET Core Windows 身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!