Started implementing oauth2 based on MoonCore helper services
Its more or less a test how well the helper services improve the implementation. I havent implemented anything fancy here atm. Just testing the oauth2 flow
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
namespace Moonlight.ApiServer.Configuration;
|
||||
using MoonCore.Helpers;
|
||||
|
||||
namespace Moonlight.ApiServer.Configuration;
|
||||
|
||||
public class AppConfiguration
|
||||
{
|
||||
public string PublicUrl { get; set; } = "http://localhost:5165";
|
||||
|
||||
public DatabaseConfig Database { get; set; } = new();
|
||||
public AuthenticationConfig Authentication { get; set; } = new();
|
||||
public DevelopmentConfig Development { get; set; } = new();
|
||||
@@ -19,12 +23,25 @@ public class AppConfiguration
|
||||
|
||||
public class AuthenticationConfig
|
||||
{
|
||||
public string Secret { get; set; } = Guid
|
||||
.NewGuid()
|
||||
.ToString()
|
||||
.Replace("-", "");
|
||||
public string MlAccessSecret { get; set; } = Formatter.GenerateString(32);
|
||||
public string MlRefreshSecret { get; set; } = Formatter.GenerateString(32);
|
||||
|
||||
public string Secret { get; set; } = Formatter.GenerateString(32);
|
||||
|
||||
public int TokenDuration { get; set; } = 10;
|
||||
|
||||
public bool UseLocalOAuth2Service { get; set; } = true;
|
||||
public string AccessSecret { get; set; } = Formatter.GenerateString(32);
|
||||
public string RefreshSecret { get; set; } = Formatter.GenerateString(32);
|
||||
public string ClientId { get; set; } = Formatter.GenerateString(8);
|
||||
public string ClientSecret { get; set; } = Formatter.GenerateString(32);
|
||||
public string? AuthorizationUri { get; set; }
|
||||
public string? AuthorizationRedirect { get; set; }
|
||||
public string? AccessEndpoint { get; set; }
|
||||
public string? RefreshEndpoint { get; set; }
|
||||
|
||||
// Local OAuth2 Service
|
||||
public string CodeSecret { get; set; } = Formatter.GenerateString(32);
|
||||
}
|
||||
|
||||
public class DevelopmentConfig
|
||||
|
||||
Reference in New Issue
Block a user