Initial DI attempt

This commit is contained in:
Scott Brady
2020-05-15 15:21:15 +01:00
parent 6a801a3542
commit c9f9706523
9 changed files with 57 additions and 276 deletions

View File

@@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Core.Mapping;
using Umbraco.Web.BackOffice.Identity;
namespace Umbraco.Extensions
{
public static class UmbracoBackOfficeServiceCollectionExtensions
{
public static void AddUmbracoBackOfficeIdentity(this IServiceCollection services)
{
services.AddIdentity<BackOfficeIdentityUser, IdentityRole>()
.AddDefaultTokenProviders()
.AddUserStore<BackOfficeUserStore>();
// .AddClaimsPrincipalFactory<UserClaimsPrincipalFactory<BackOfficeIdentityUser, IdentityRole>>() // TODO: extract custom claims principal factory
// .AddUserManager<BackOfficeUserManager<BackOfficeIdentityUser>>()
}
}
}