Closed adrianorc closed 9 years ago
I think you forgot to register a IUserStore in the registration system. I suspect this line:
factory.Register(new Registration<ApplicationUser>());
was a typo.
Well, in fact I had to redeclare all classes of asp.net.identity.core as following:
public static class UserServiceExtensions
{
public static void ConfigureUserService(this IdentityServerServiceFactory factory, string connString)
{
factory.UserService = new Registration<IUserService, UserService>();
factory.Register(new Registration<UserManager>());
factory.Register( new Registration<UserStore>() );
factory.Register(new Registration<ApplicationDbContext>());
}
}
public class UserService : AspNetIdentityUserService<ApplicationUser, string>
{
public UserService(UserManager userMgr)
: base(userMgr)
{
}
}
public class UserStore : UserStore<ApplicationUser>
{
public UserStore(ApplicationDbContext ctx)
: base(ctx)
{
}
}
public class UserManager : ApplicationUserManager
{
public UserManager(UserStore store)
: base(store)
{
}
}
Now it works.
Anyway, thanks for you attention.
Hi,
I'm trying to set up IdentityServer3 and AspNetIdentity with the default entities of Asp.net Identity as following:
When I run the application and click in application permissions, for exemple, an error message appears:
{"None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Usuarios.ApplicationUserManager' can be invoked with the available services and parameters:\r\nCannot resolve parameter 'Microsoft.AspNet.Identity.IUserStore
1[Usuarios.Models.ApplicationUser] store' of constructor 'Void .ctor(Microsoft.AspNet.Identity.IUserStore
1[Usuarios.Models.ApplicationUser])'."}I can't figure out what I'm doing wrong.