Windows服务中托管的Kestrel的Windows身份验证 [英] Windows Authentication for Kestrel hosted in Windows service

查看:538
本文介绍了Windows服务中托管的Kestrel的Windows身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Windows服务中托管的ASP.NET Core应用程序,如下所述:

I am running an ASP.NET Core application hosted in a Windows service as described here:

https://docs.microsoft.com/zh-CN/aspnet/core/host -and-deploy / windows-service?view = aspnetcore-2.1

我需要此应用程序来支持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();

有关更多信息,请参见:

https://docs.microsoft。 com / zh-CN / aspnet / core / security / authentication / windowsauth?view = aspnetcore-3.0& tabs = visual-studio#kestrel

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

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