From b030d964ebc9c8c5a704a8c49d3485fdd09e724e Mon Sep 17 00:00:00 2001 From: koichi-kobayashi Date: Sun, 13 Nov 2022 16:22:04 +0900 Subject: [PATCH] Add ConfigureServices configure windows authentication in ASP.NET Core --- .../Getting-Started-with-CoreWCF/NetCoreServer/Program.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Scenarios/Getting-Started-with-CoreWCF/NetCoreServer/Program.cs b/Scenarios/Getting-Started-with-CoreWCF/NetCoreServer/Program.cs index a59f515..f7a2e26 100644 --- a/Scenarios/Getting-Started-with-CoreWCF/NetCoreServer/Program.cs +++ b/Scenarios/Getting-Started-with-CoreWCF/NetCoreServer/Program.cs @@ -2,8 +2,10 @@ using System.Net; using CoreWCF.Configuration; using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Authentication.Negotiate; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; namespace NetCoreServer { @@ -29,6 +31,10 @@ public static IWebHostBuilder CreateWebHostBuilder(string[] args) => } }); }) + .ConfigureServices(options => + { + options.AddAuthentication(NegotiateDefaults.AuthenticationScheme).AddNegotiate(); + }) .UseNetTcp(Startup.NETTCP_PORT) .UseStartup(); }