More attempting to read forward headers
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
afbcf4ae11
commit
b7f07c36b9
|
@ -8,6 +8,12 @@ using Microsoft.Extensions.Configuration;
|
|||
var builder = WebApplication.CreateBuilder(args);
|
||||
var Configuration = builder.Configuration;
|
||||
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders =
|
||||
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
});
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorPages();
|
||||
builder.Services.AddControllers();
|
||||
|
@ -24,7 +30,6 @@ builder.Services.AddAuthentication(options => {
|
|||
options.ClientSecret = Configuration["oidc:clientsecret"];
|
||||
options.Authority = @"https://auth.jacknet.io/auth/realms/JackNet";
|
||||
//options.Authority = String.Format("https://{0}.onelogin.com/oidc/2", Configuration["oidc:region"]);
|
||||
|
||||
options.ResponseType = "code";
|
||||
options.GetClaimsFromUserInfoEndpoint = true;
|
||||
}
|
||||
|
@ -36,10 +41,10 @@ var app = builder.Build();
|
|||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseExceptionHandler("/Error");
|
||||
app.UseForwardedHeaders();
|
||||
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
|
||||
app.UseForwardedHeaders();
|
||||
}
|
||||
|
||||
app.UseStaticFiles();
|
||||
|
|
Loading…
Reference in New Issue