2026-02-01 04:23:12 -06:00
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
2026-02-01 04:27:06 -06:00
|
|
|
builder.Services.AddValidation();
|
2026-02-03 11:39:22 -06:00
|
|
|
builder.Services.AddProblemDetails();
|
2026-02-01 04:23:12 -06:00
|
|
|
|
2026-02-02 04:48:42 -06:00
|
|
|
builder.Services.AddInfrastructure();
|
2026-02-01 06:13:08 -06:00
|
|
|
|
2026-02-03 11:07:18 -06:00
|
|
|
builder.Services.AddAuthentication(static o =>
|
|
|
|
|
{
|
|
|
|
|
o.DefaultAuthenticateScheme = Schemes.Default;
|
|
|
|
|
o.DefaultChallengeScheme = Schemes.Default;
|
|
|
|
|
})
|
|
|
|
|
.AddJwtBearer(Schemes.Default)
|
|
|
|
|
.AddJwtBearer(Schemes.AllowExpiredTokens);
|
|
|
|
|
|
|
|
|
|
builder.Services.AddAuthorizationBuilder()
|
|
|
|
|
.AddPolicy(Schemes.Default, static policy =>
|
|
|
|
|
{
|
|
|
|
|
policy.AuthenticationSchemes = [Schemes.Default];
|
|
|
|
|
policy.RequireAuthenticatedUser();
|
|
|
|
|
})
|
|
|
|
|
.AddPolicy(Schemes.AllowExpiredTokens, static policy =>
|
|
|
|
|
{
|
|
|
|
|
policy.AuthenticationSchemes = [Schemes.AllowExpiredTokens];
|
|
|
|
|
policy.RequireAuthenticatedUser();
|
|
|
|
|
});
|
|
|
|
|
|
2026-02-01 04:23:12 -06:00
|
|
|
var app = builder.Build();
|
|
|
|
|
|
2026-02-03 11:39:22 -06:00
|
|
|
app.UseHttpsRedirection();
|
2026-02-03 11:07:18 -06:00
|
|
|
app.UseAuthentication();
|
|
|
|
|
app.UseAuthorization();
|
2026-02-03 11:39:22 -06:00
|
|
|
app.UseStatusCodePages();
|
2026-02-01 04:23:12 -06:00
|
|
|
|
2026-02-13 21:20:05 -06:00
|
|
|
app.MapAuthEndpoints();
|
2026-02-12 13:12:14 -06:00
|
|
|
app.MapAccountsEndpoints();
|
2026-02-13 21:20:05 -06:00
|
|
|
app.MapInstitutionsEndpoints();
|
2026-02-12 13:12:14 -06:00
|
|
|
|
2026-02-01 04:23:12 -06:00
|
|
|
app.Run();
|