Linux 上的 ASP.NET Core Windows 身份验证 [英] ASP.NET Core Windows Authentication on Linux

查看:45
本文介绍了Linux 上的 ASP.NET Core Windows 身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆