last ...
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user