Windows服务中托管的Kestrel的Windows身份验证 [英] Windows Authentication for Kestrel hosted in Windows service
问题描述
我正在运行Windows服务中托管的ASP.NET Core应用程序,如下所述:
I am running an ASP.NET Core application hosted in a Windows service as described here:
我需要此应用程序来支持Windows身份验证。我有什么选择?我尝试将IIS中的应用程序请求路由/ URL重写模块用作Windows身份验证的反向代理,但无法弄清楚如何使它工作。任何指导将不胜感激。
I need this application to support Windows Authentication. What are my options? I tried using Application Request Routing / URL Rewrite module in IIS as a reverse proxy with Windows Authentication but could not figure out how to make that work. Any guidance would be appreciated.
推荐答案
借助.Net Core 3.0,您可以将Windows身份验证与Kestrel一起使用。有一个Nuget程序包: Microsoft.AspNetCore.Authentication.Negotiate
With .Net Core 3.0 you can use Windows Authentication with Kestrel. There is a Nuget Package for it: Microsoft.AspNetCore.Authentication.Negotiate
然后可以在Startup.ConfigureServices中添加它:
You then can add it in Startup.ConfigureServices:
services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
.AddNegotiate();
For more Information also see:
https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-3.0&tabs=visual-studio#kestrel
这篇关于Windows服务中托管的Kestrel的Windows身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!