The classes in Microsoft.AspNet.Identity.Core
have no dependency on Entity Framework and can be used with any persistence store.
You will need to provide your own version of the UserStore and possibly the RoleStore (if you need it) classes from Microsoft.AspNet.Identity.EntityFramework
though. You don't want to include Microsoft.AspNet.Identity.EntityFramework
when using a NoSQL database.
Depending on what you need you will have to implement a number of interfaces on you UserStore. You need to at least implement IUserStore
, IUserPasswordStore
, IUserSecurityStampStore
and IUserLoginStore
. The Microsoft provided Entity Framework UserStore
implements IUserClaimStore<TUser>
and IUserRoleStore<TUser>
which you may or may not need to implement depending on what methods of the UserManager you will call.
Assuming that you skip IUserClaimStore and IUserRoleStore, it's 14 methods to implement, most of them pretty straight forward to implement though. These 14 methods is enough to support the parts that are used from the AccountController from the default templates.
I have a project on GitHub where I tried something similar myself, i.e. I implemented a UserStore that use MongoDb instead of EntityFramework for persistence.