feat(api): аутентификация и авторизация. Кастомные ParrAuthenticationHandler и BaseSimpleRoleProvider.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
|
||||
namespace PARR.API.RoleProvider
|
||||
{
|
||||
public static class SimpleRoleAuthorizationServiceCollectionExtensions
|
||||
{
|
||||
public static void AddSimpleRoleAuthorization<TRoleProvider>(this IServiceCollection services)
|
||||
where TRoleProvider : class, ISimpleRoleProvider
|
||||
{
|
||||
services.AddSingleton<ISimpleRoleProvider, TRoleProvider>();
|
||||
services.AddSingleton<IClaimsTransformation, SimpleRoleAuthorizationTransform>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user