fix: uri redirect para microsoft
This commit is contained in:
parent
4ed2d2243d
commit
e8fad24cc8
11
Program.cs
11
Program.cs
@ -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())
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user