This commit is contained in:
2026-11-15 17:52:54 +03:30
parent 24363e89ae
commit 3a556a329a
8 changed files with 2727 additions and 8 deletions
+19
View File
@@ -19,6 +19,7 @@ using xCommons.Authorization;
using System.Collections.Generic;
using xMessageService.Interfaces;
using xStorageService.Interfaces;
using xIdentityModels.Interfaces;
using xIdentityService.Interfaces;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Logging;
@@ -81,6 +82,20 @@ namespace xIds.DI
return config.GetConnectionString(connectionName);
}
/// <summary>
/// Register Scope/Role/Policy Providers ...
/// </summary>
/// <param name="source"></param>
public static void AddXAuthorizationProviders(
this IServiceCollection source
)
{
//
source.AddScoped<IXRoleProvider, XRoleProvider>();
source.AddScoped<IXScopeProvider, XScopeProvider>();
source.AddScoped<IXPolicyProvider, XPolicyProvider>();
}
/// <summary>
/// Retrive XDataService Configurations ...
/// </summary>
@@ -531,6 +546,10 @@ namespace xIds.DI
//
services.AddSingleton<IAuthorizationHandler, RequiredRolesHandler>();
//
// Register Providers ...
services.AddXAuthorizationProviders();
}
/// <summary>