# RavenDB.AspNet.Identity #
RavenDB identity provider for ASP.NET MVC 5+ and Web API 2+. (Looking for .NET Core identity provider for RavenDB? Check out our sister project, RavenDB.Identity.)
We're on NuGet as RavenDB.AspNet.Identity.
Create a new ASP.NET MVC 5 project, choosing the Individual User Accounts authentication type.
Remove the Entity Framework packages and replace with RavenDB Identity:
In ~/Models/IdentityModels.cs:
In ~/App_Start/IdentityConfig.cs
public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
{
var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(context.Get<IAsyncDocumentSession>()));
...
}
In ~/App_Start/Startup.Auth.cs:
// Old: app.CreatePerOwinContext(ApplicationDbContext.Create);
// New. The raven variable is your Raven DocumentStore singleton.
app.CreatePerOwinContext(() => raven.OpenAsyncSession());
Add a RavenController.cs class.
Make AccountController.cs inherit from RavenController
public class AccountController : RavenController
{
...
}