Enhance external login and proxy compatibility
Build and Push Docker Image / build-and-push (push) Successful in 22s
Build and Push Docker Image / build-and-push (push) Successful in 22s
- Updated `ExternalLoginPicker.razor` to add Google and Microsoft login buttons with SVG icons and improved styling. - Added new styles in `ExternalLoginPicker.razor.css` for layout and accessibility. - Configured `ForwardedHeadersOptions` and enabled `UseForwardedHeaders` middleware in `Program.cs` for reverse proxy support. - Added `AddCascadingAuthenticationState` for better authentication state management. - Included `microsoft-identity-association.json` for Microsoft app association. - Added `google-signin.svg` and `microsoft-signin.svg` assets for login buttons.
This commit is contained in:
@@ -4,6 +4,7 @@ using BirthList.Web.Configuration;
|
||||
using BirthList.Web.Features.Registries;
|
||||
using BirthList.Web.Services;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
@@ -25,6 +26,13 @@ builder.Services.AddHttpClient("RegistryMetadata", client =>
|
||||
});
|
||||
builder.Services.Configure<SmtpOptions>(builder.Configuration.GetSection("Smtp"));
|
||||
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
options.KnownNetworks.Clear();
|
||||
options.KnownProxies.Clear();
|
||||
});
|
||||
|
||||
builder.Services.AddCascadingAuthenticationState();
|
||||
builder.Services.AddScoped<IdentityUserAccessor>();
|
||||
builder.Services.AddScoped<IdentityRedirectManager>();
|
||||
@@ -150,6 +158,7 @@ else
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseForwardedHeaders();
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseStaticFiles();
|
||||
|
||||
Reference in New Issue
Block a user