Enhance authentication and logging configurations
- Updated `AuthController` to monitor backdoor parameters and enhance user credential validation. - Changed route for `Hash` method in `CryptController` for clarity. - Improved case-insensitivity in username comparisons in `BackdoorExtensions`. - Modified logging setup in `Program.cs` to clear providers and set minimum level to Trace. - Added separate logging configuration for warnings in `appsettings.json`. - Restructured `backdoors.json` to encapsulate entries within `BackdoorParams`.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using DigitalData.Auth.API.Config;
|
||||
using DigitalData.Auth.API.Entities;
|
||||
using DigitalData.Auth.API.Hubs;
|
||||
using DigitalData.Auth.API.Models;
|
||||
using DigitalData.Auth.API.Services;
|
||||
using DigitalData.Core.Abstractions.Security.Extensions;
|
||||
using DigitalData.Core.Abstractions.Security.Services;
|
||||
@@ -10,7 +9,7 @@ using DigitalData.Core.Security.Extensions;
|
||||
using DigitalData.UserManager.Application;
|
||||
using DigitalData.UserManager.Application.DTOs.User;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.IdentityModel.JsonWebTokens;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Microsoft.OpenApi.Models;
|
||||
@@ -24,6 +23,10 @@ try
|
||||
{
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Logging.ClearProviders();
|
||||
builder.Logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
|
||||
builder.Host.UseNLog();
|
||||
|
||||
builder.Configuration.AddJsonFile("consumer-repository.json", true, true);
|
||||
|
||||
builder.Configuration.AddJsonFile("consumer-repository.json", true, true);
|
||||
@@ -35,7 +38,7 @@ try
|
||||
var apiParams = config.Get<AuthApiParams>() ?? throw new InvalidOperationException("AuthApiOptions is missing or invalid in appsettings.");
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.Configure<Backdoor>(config.GetSection("Backdoors"));
|
||||
builder.Services.Configure<BackdoorParams>(config.GetSection(nameof(BackdoorParams)));
|
||||
builder.Services.Configure<AuthApiParams>(config);
|
||||
builder.Services.AddAuthService(config);
|
||||
builder.Services.AddRSAPool(config.GetSection("CryptParams"));
|
||||
|
||||
Reference in New Issue
Block a user