Asp.net core 如何将IdentityManager与AspNetCoreIdentity一起使用
是否有机会使用AspNet核心标识访问用户标识Manager 我没有找到针对AspNetCoreidentity的IIDentityManager服务的任何实现 或者,在使用AspnetCore identity时是否有IdentityManager的替代品Asp.net core 如何将IdentityManager与AspNetCoreIdentity一起使用,asp.net-core,asp.net-identity,identitymanager,Asp.net Core,Asp.net Identity,Identitymanager,是否有机会使用AspNet核心标识访问用户标识Manager 我没有找到针对AspNetCoreidentity的IIDentityManager服务的任何实现 或者,在使用AspnetCore identity时是否有IdentityManager的替代品 谢谢。是的,您可以使用IdentityManager管理您的AspNetIdentity用户 IdentityManager本身有一个名为IdentityManager.AsNetIdentity的实现。你可能想通读一遍 实际上,您要做的是
谢谢。是的,您可以使用IdentityManager管理您的AspNetIdentity用户 IdentityManager本身有一个名为IdentityManager.AsNetIdentity的实现。你可能想通读一遍 实际上,您要做的是加载从
AspNetIdentityManagerService继承的IdentityManagerService
public class ApplicationIdentityManagerService : AspNetIdentityManagerService<ApplicationUser, string, IdentityRole, string>
{
public ApplicationIdentityManagerService(ApplicationUserManager userMgr, ApplicationRoleManager roleMgr) : base(userMgr, roleMgr)
{
// Nothing
}
}
公共类应用程序身份管理服务:上的AspNetIdentityManager服务。请查看@Nkosi:我指的是IdentityManager(),它是一个用于管理用户、角色等的SPA应用程序。好的,我的误解是:我找到了您的回复“”-请详细说明如何实现它?我想我会找到答案的,但目前我将推迟实施,并将重点放在其他方面,我正在为一篇博客文章构建一个小型演示应用程序,在.net core Identity的基础上使用.net core、asp.net core和Identity Server。谢谢:)查收。使用“AspNetCoreIdentityManager服务”代替“InMemoryIdentityManager服务”
app.Map("/users", idm =>
{
var factory = new IdentityManagerServiceFactory();
factory.IdentityManagerService = new Registration<IIdentityManagerService, ApplicationIdentityManagerService>();
factory.Register(new Registration<ApplicationUserManager>());
factory.Register(new Registration<ApplicationUserStore>());
factory.Register(new Registration<ApplicationRoleManager>());
factory.Register(new Registration<ApplicationRoleStore>());
factory.Register(new Registration<ApplicationDbContext>(resolver => new ApplicationDbContext("dbase")));
factory.Register(new Registration<ApplicationDbContext>());
idm.UseIdentityManager(new IdentityManagerOptions {
Factory = factory
});
});