added permission configuration

This commit is contained in:
2024-12-21 14:59:04 +01:00
parent 51c15eff4c
commit 92afc85dba
13 changed files with 138 additions and 36 deletions

View File

@@ -1,3 +1,4 @@
using HopFrame.Security.Authorization;
using HopFrame.Security.Claims;
using HopFrame.Security.Options;
using Microsoft.AspNetCore.Authentication;
@@ -20,6 +21,7 @@ public static class HopFrameAuthenticationExtensions {
service.AddScoped<ITokenContext, TokenContextImplementor>();
service.AddOptionsFromConfiguration<HopFrameAuthenticationOptions>(configuration);
service.AddOptionsFromConfiguration<AdminPermissionOptions>(configuration);
service.AddAuthentication(HopFrameAuthentication.SchemeName).AddScheme<AuthenticationSchemeOptions, HopFrameAuthentication>(HopFrameAuthentication.SchemeName, _ => {});
service.AddAuthorization();