[CHANGE] Reworking auth schemes & services, handlers, etc.

This commit is contained in:
max
2025-04-27 17:23:14 +02:00
parent 8e72d123fd
commit 46cf20893b
15 changed files with 249 additions and 64 deletions

View File

@@ -0,0 +1,7 @@
namespace DotBased.AspNet.Authority.Models.Data.Auth;
public class AuthenticationSessionType
{
public string Id { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,16 @@
namespace DotBased.AspNet.Authority.Models.Data.Auth;
public class AuthenticationType
{
public string Id { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string Provider { get; set; } = string.Empty;
public bool Redirects { get; set; }
public AuthenticationTypePaths Paths { get; set; } = new();
}
public class AuthenticationTypePaths
{
public string Login { get; set; } = string.Empty;
public string Logout { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,10 @@
using DotBased.AspNet.Authority.Models.Data.Auth;
namespace DotBased.AspNet.Authority.Models.Data.System;
public class AboutModel
{
public string Name { get; set; } = "Authority.Server";
public List<AuthenticationType> AuthenticationTypes { get; set; } = [];
public List<AuthenticationSessionType> SessionTypes { get; set; } = [];
}

View File

@@ -0,0 +1,14 @@
namespace DotBased.AspNet.Authority.Models.Options.Auth;
public class AuthenticationSecurityOptions
{
public SecurityMode SecurityMode { get; set; } = SecurityMode.Normal;
public List<string> AllowedLoginMethods { get; set; } = ["*"];
}
public enum SecurityMode
{
Loose = 0,
Normal = 1,
Strict = 2
}

View File

@@ -0,0 +1,8 @@
namespace DotBased.AspNet.Authority.Models.Options.Auth;
public class AuthorityAuthenticationOptions
{
public AuthenticationSecurityOptions Security { get; set; } = new AuthenticationSecurityOptions();
public SessionOptions Session { get; set; } = new SessionOptions();
public string DefaultScheme { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,6 @@
namespace DotBased.AspNet.Authority.Models.Options.Auth;
public class SessionOptions
{
public TimeSpan RefreshInterval { get; set; } = TimeSpan.FromMinutes(30);
}