15 lines
407 B
C#
15 lines
407 B
C#
|
using AuthRequirementsData.Authorization;
|
||
|
using Microsoft.AspNetCore.Authorization;
|
||
|
|
||
|
var builder = WebApplication.CreateBuilder();
|
||
|
|
||
|
builder.Services.AddAuthentication().AddJwtBearer();
|
||
|
builder.Services.AddAuthorization();
|
||
|
builder.Services.AddControllers();
|
||
|
builder.Services.AddSingleton<IAuthorizationHandler, MinimumAgeAuthorizationHandler>();
|
||
|
|
||
|
var app = builder.Build();
|
||
|
|
||
|
app.MapControllers();
|
||
|
|
||
|
app.Run();
|