且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows服务中托管的Kestrel的Windows身份验证

更新时间:2023-11-30 23:03:22

借助.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