fix: uri redirect para microsoft
All checks were successful
Deploy QR Rapido / test (push) Successful in 28s
Deploy QR Rapido / build-and-push (push) Successful in 6m51s
Deploy QR Rapido / deploy-staging (push) Has been skipped
Deploy QR Rapido / deploy-production (push) Successful in 1m56s

This commit is contained in:
Ricardo Carneiro 2025-08-12 21:03:15 -03:00
parent 4ed2d2243d
commit e8fad24cc8

View File

@ -19,6 +19,7 @@ using Serilog;
using Serilog.Events;
using Serilog.Sinks.SystemConsole.Themes;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.AspNetCore.HttpOverrides;
var builder = WebApplication.CreateBuilder(args);
@ -135,7 +136,6 @@ builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationSc
options.ClientId = builder.Configuration["Authentication:Microsoft:ClientId"];
options.ClientSecret = builder.Configuration["Authentication:Microsoft:ClientSecret"];
// ADICIONE ESTAS LINHAS:
options.AuthorizationEndpoint = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
options.TokenEndpoint = "https://login.microsoftonline.com/common/oauth2/v2.0/token";
@ -221,8 +221,17 @@ builder.Services.AddHealthChecks()
.AddCheck<ResourceHealthCheck>("resources")
.AddCheck<ExternalServicesHealthCheck>("external_services");
builder.Services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
options.KnownProxies.Clear();
options.KnownNetworks.Clear();
});
var app = builder.Build();
app.UseForwardedHeaders();
// Configure the HTTP request pipeline
if (!app.Environment.IsDevelopment())
{