refactor: remove ConfigureWebApiExtensionsAtFirst extension

This commit is contained in:
Developer 02
2024-08-05 15:21:42 +02:00
parent 1f9fb4163b
commit 8190e0005a
2 changed files with 21 additions and 23 deletions

View File

@@ -17,6 +17,7 @@ using HRD.WebApi.DAL.Middleware;
using HRD.WebApi.Helpers;
using StaffDBServer.SharedControllers;
using HRD.LDAPService;
using Microsoft.AspNetCore.Server.IISIntegration;
AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) =>
{
@@ -41,7 +42,26 @@ try
builder.Host.UseNLog();
// Add services to the container
builder.Services.ConfigureWebApiExtensionsAtFirst(); // at first
// at first
//services.AddCors();
builder.Services.AddCustomCors("AllowAllOrigins");
builder.Services.Configure<IISOptions>(options =>
{
options.AuthenticationDisplayName = "Windows";
options.ForwardClientCertificate = true;
options.AutomaticAuthentication = true;
});
builder.Services.AddAuthentication(IISDefaults.AuthenticationScheme);
builder.Services.ConfigureJWT(StaffDBServer.Extends.JwtMiddlewareOptionsHelper.GetJwtMiddlewareOptions()); ;
builder.Services.ConfigureDAL(WebApiMiddlewareOptionsHelper.GetWebApiMiddlewareOptions());
builder.Services.AddSingleton<ILoggerManager, LoggerManager>();
builder.Services.ConfigureSwagger();
builder.Services.ConfigureRepositoryWrapper(); // add repos
var cnnStr = WebApiConfig.ConnectionString(EN_ConnectionType.SQLServer);