[ADD] Base Authority initial commit

This commit is contained in:
max
2024-12-21 15:30:17 +01:00
parent 21675300bb
commit 2361e12847
18 changed files with 155 additions and 30 deletions

View File

@@ -2,6 +2,7 @@ using DotBased.Logging;
using DotBased.Logging.MEL;
using DotBased.Logging.Serilog;
using Serilog;
using TestWebApi;
using ILogger = Serilog.ILogger;
var builder = WebApplication.CreateBuilder(args);
@@ -18,6 +19,12 @@ LogService.AddLogAdapter(new BasedSerilogAdapter(serilogLogger));
builder.Logging.ClearProviders();
builder.Logging.AddDotBasedLoggerProvider(LogService.Options);
/*builder.Services.AddAuthentication(options =>
{
options.DefaultScheme = BasedAuthenticationDefaults.BasedAuthenticationScheme;
options.DefaultChallengeScheme = BasedAuthenticationDefaults.BasedAuthenticationScheme;
}).AddCookie();*/
// Add services to the container.
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
@@ -25,6 +32,8 @@ builder.Services.AddSwaggerGen();
var app = builder.Build();
await SeedAuthorityData.InitializeData(app.Services);
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{

View File

@@ -0,0 +1,9 @@
namespace TestWebApi;
public class SeedAuthorityData
{
public static async Task InitializeData(IServiceProvider serviceProvider)
{
// Get the needed services and create users, roles, attributes. etc.
}
}

View File

@@ -13,6 +13,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DotBased.AspNet.Authority\DotBased.AspNet.Authority.csproj" />
<ProjectReference Include="..\DotBased.Logging.MEL\DotBased.Logging.MEL.csproj" />
<ProjectReference Include="..\DotBased.Logging.Serilog\DotBased.Logging.Serilog.csproj" />
<ProjectReference Include="..\DotBased\DotBased.csproj" />