LANCommander/LANCommander.Server.Settings/Models/AuthenticationSettings.cs
Pat Hartl 0f03461f53 Add setting to auto redirect to external provider
When enabled, AutoRedirectToProvider will switch authentication challenges to redirect to the external auth provider instead of displaying the password login form. If more than one external provider is configured, a minimal external auth provider login page will be shown.

Ref #410
2026-06-21 01:59:15 -05:00

31 lines
No EOL
1.2 KiB
C#

using Microsoft.AspNetCore.Http;
namespace LANCommander.Server.Settings.Models;
public class AuthenticationSettings
{
public bool RequireApproval { get; set; } = false;
public bool AllowRegistration { get; set; } = true;
public bool AutoRedirectToProvider { get; set; } = false;
public string TokenSecret { get; set; } = Guid.NewGuid().ToString();
public int TokenLifetime { get; set; } = 30;
public bool PasswordRequireNonAlphanumeric { get; set; } = false;
public bool PasswordRequireLowercase { get; set; } = false;
public bool PasswordRequireUppercase { get; set; } = false;
public bool PasswordRequireDigit { get; set; } = true;
public int PasswordRequiredLength { get; set; } = 8;
public CookiePolicy HttpCookiePolicy { get; set; } = new()
{
SameSite = SameSiteMode.Lax,
Secure = CookieSecurePolicy.None
};
public CookiePolicy HttpsCookiePolicy { get; set; } = new()
{
SameSite = SameSiteMode.None,
Secure = CookieSecurePolicy.SameAsRequest
};
public IEnumerable<AuthenticationProvider> AuthenticationProviders { get; set; } = new List<AuthenticationProvider>();
}