linux - Linux 上的 ASP.NET Core Windows 身份验证
问题描述
我在 Linux 容器中运行 ASP.NET Core Web 应用程序。我需要为我的应用程序提供 Windows 身份验证。如何实施?
我假设可以使用可以通过 Kerberos 进行身份验证的反向代理服务器来解决问题。
解决方案
从 ASP.NET Core 3.0 开始,现在可以通过添加Microsoft.AspNetCore.Authentication.Negotiate NuGet 包在 Linux 和 MacOS 上使用 Windows 身份验证,并在您的Startup.ConfigureServices
方法中使用它:
services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
.AddNegotiate();
这在Startup.Configure
:
app.UseAuthentication();
以及文档中描述的一些附加配置。
推荐阅读
- python - 无法使用 pip 安装 selenium
- javascript - CSS不适用于通过Javascript新添加的元素
- apache-kafka - 如何通过 REST 或任何方式轻松地将流结果保存到远程数据库中
- protractor - 使用黄瓜量角器进行数据驱动测试
- html - Vuetify:如何创建内容居中的流畅页脚?
- amazon-web-services - 服务员问题 AWS PHP SDK3
- css - LESS/ CSS :在图片上写静态文本
- android-emulator - 应用程序不运行 Android Studio 模拟器问题
- yii2 - 如何在 Yii2 中追加新行 Kartik gridview 并将数据保存到数据库?
- javascript - 如何设置具有内容宽度的文本区域?