Configura authentication and authorization

This commit is contained in:
Oscar Morales
2025-07-15 14:04:07 -06:00
parent 0429704cac
commit 482a330a39
8 changed files with 61 additions and 29 deletions

View File

@@ -1,10 +1,10 @@
using Asp.Versioning;
using Azure.Identity;
using Core.Blueprint.Logging.Configuration;
using Core.Thalos.Adapters.Contracts;
using Core.Thalos.Adapters.Extensions;
using Core.Thalos.Adapters.Services;
using Core.Thalos.BuildingBlocks.Authentication.Extensions;
using Core.Thalos.External.ClientConfiguration;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.Extensions.Configuration.AzureAppConfiguration;
using OpenTelemetry.Logs;
using OpenTelemetry.Resources;
using Swashbuckle.AspNetCore.SwaggerUI;
@@ -13,6 +13,8 @@ using System.Reflection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.ConfigureAuthentication(builder.Configuration);
builder.Services.AddEndpointsApiExplorer();
builder.Configuration
.AddUserSecrets(Assembly.GetExecutingAssembly())
@@ -81,7 +83,7 @@ builder.Host.ConfigureServices((context, services) =>
services.AddResponseCaching();
services.AddControllers();
services.AddEndpointsApiExplorer();
services.AddSwaggerGen();
services.AddSwaggerGen(builder.Configuration);
services.AddLogging();
services.AddProblemDetails();
services.AddHttpContextAccessor();
@@ -107,6 +109,8 @@ builder.Services.AddCors(options =>
});
});
builder.Services.AddScoped<ITokenService, TokenService>();
//*************************************************************************//
var app = builder.Build();