Possible fix for incorrect auth redirect location
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -19,7 +19,8 @@ namespace WebNovelPortal.Controllers
|
|||||||
{
|
{
|
||||||
await HttpContext.ChallengeAsync(new AuthenticationProperties
|
await HttpContext.ChallengeAsync(new AuthenticationProperties
|
||||||
{
|
{
|
||||||
RedirectUri = redirect
|
RedirectUri = redirect,
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.AspNetCore.Components.Web;
|
using Microsoft.AspNetCore.Components.Web;
|
||||||
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Treestar.Shared.AccessLayers;
|
using Treestar.Shared.AccessLayers;
|
||||||
using Treestar.Shared.Authentication.OIDC;
|
using Treestar.Shared.Authentication.OIDC;
|
||||||
@@ -19,6 +20,11 @@ builder.Services.AddControllers().AddNewtonsoftJson(opt =>
|
|||||||
opt.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
|
opt.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
|
||||||
});
|
});
|
||||||
builder.Services.AddOIDCAuth(builder.Configuration);
|
builder.Services.AddOIDCAuth(builder.Configuration);
|
||||||
|
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||||
|
{
|
||||||
|
options.ForwardedHeaders =
|
||||||
|
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||||
|
});
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
@@ -26,9 +32,15 @@ var app = builder.Build();
|
|||||||
if (!app.Environment.IsDevelopment())
|
if (!app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/Error");
|
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.
|
// 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.UseHsts();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.UseDeveloperExceptionPage();
|
||||||
|
app.UseForwardedHeaders();
|
||||||
|
}
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user