Directory Search API in die Benutzer-/Gruppenimport-Komponente im Angular-Frontend integriert.
This commit is contained in:
@@ -9,8 +9,6 @@ using DigitalData.Core.Application;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using NLog.Web;
|
||||
using NLog;
|
||||
using System.DirectoryServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
||||
logger.Debug("init main");
|
||||
@@ -24,21 +22,6 @@ try {
|
||||
builder.Logging.ClearProviders();
|
||||
builder.Host.UseNLog();
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
try
|
||||
{
|
||||
using DirectoryEntry rootDSE = new("LDAP://RootDSE");
|
||||
string defaultNamingContext = rootDSE.Properties["defaultNamingContext"]?.Value?.ToString() ?? "NULL";
|
||||
string ldapPath = $"LDAP://{defaultNamingContext}";
|
||||
logger.Info($"Local LDAP Path: {ldapPath}");
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
logger.Warn(exception, "Local LDAP Path cannot found.");
|
||||
}
|
||||
else
|
||||
logger.Warn("Directory service will not operate because the operating system is not Windows.");
|
||||
|
||||
builder.Services.AddControllers();
|
||||
|
||||
if (builder.Configuration.GetValue<bool>("UseSwagger"))
|
||||
@@ -54,11 +37,12 @@ try {
|
||||
{
|
||||
options.Cookie.HttpOnly = true;
|
||||
//options.Cookie.SecurePolicy = CookieSecurePolicy.Always; //always https
|
||||
options.Cookie.SameSite = SameSiteMode.None; // allows Cross-site requests
|
||||
options.Cookie.SameSite = SameSiteMode.None;
|
||||
options.LoginPath = "/api/auth/login";
|
||||
options.LogoutPath = "/api/auth/logout";
|
||||
});
|
||||
|
||||
|
||||
builder.Services.AddDbContext<DDECMDbContext>(options =>
|
||||
options.UseSqlServer(builder.Configuration.GetConnectionString("DD_ECM_Connection"))
|
||||
.EnableDetailedErrors());
|
||||
@@ -101,7 +85,7 @@ try {
|
||||
builder.Services.AddScoped<IModuleOfUserService, ModuleOfUserService>();
|
||||
builder.Services.AddScoped<IUserRepService, UserRepService>();
|
||||
|
||||
builder.Services.AddDirectoryService();
|
||||
builder.Services.AddDirectorySearchService();
|
||||
builder.Services.AddResponseService();
|
||||
|
||||
var app = builder.Build();
|
||||
@@ -114,12 +98,15 @@ try {
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
app.UseDefaultFiles();
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseRouting();
|
||||
app.UseHttpsRedirection();
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
//app.MapControllers();
|
||||
app.MapControllers();
|
||||
|
||||
app.MapDefaultControllerRoute();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user