[ADD] Base Authority initial commit
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
9
TestWebApi/SeedAuthorityData.cs
Normal file
9
TestWebApi/SeedAuthorityData.cs
Normal 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.
|
||||
}
|
||||
}
|
@@ -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" />
|
||||
|
Reference in New Issue
Block a user