ASP.NET Identity provider that uses RavenDB for storage of users and logins.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.nuget
.vs
RavenDB.AspNet.Identity.Tests Updated to Raven 4. Added sample app. Mar 19, 2018
RavenDB.AspNet.Identity
Sample
packages
.gitattributes
.gitignore Updated to Raven 4. Added sample app. Mar 19, 2018
Create-NuGet-Package.bat
LICENSE.md
NOTICE.md Moved .NET Core identity provider to separate repo. Aug 23, 2017
README.md More readme formatting Mar 19, 2018
RavenDB.AspNet.Identity.sln

README.md

RavenDB logo 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.

Instructions

  1. Create a new ASP.NET MVC 5 project, choosing the Individual User Accounts authentication type.

  2. Remove the Entity Framework packages and replace with RavenDB Identity:

    • Uninstall-Package Microsoft.AspNet.Identity.EntityFramework
    • Uninstall-Package EntityFramework
    • Install-Package RavenDB.AspNet.Identity
  3. In ~/Models/IdentityModels.cs:

    • Remove the namespace: Microsoft.AspNet.Identity.EntityFramework
    • Add the namespace: Raven.AspNet.Identity
    • Remove the entire ApplicationDbContext class. You don't need that!
  4. In ~/App_Start/IdentityConfig.cs

    • Update the ApplicationUserManager.Create method to get the Raven document session.
    public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context) 
    {
    	var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(context.Get<IAsyncDocumentSession>()));
    	...
    }
  5. In ~/App_Start/Startup.Auth.cs:

    • Remove the Entity framework context and add a RavenDB context:
    // Old: app.CreatePerOwinContext(ApplicationDbContext.Create);
    // New. The raven variable is your Raven DocumentStore singleton.
    app.CreatePerOwinContext(() => raven.OpenAsyncSession());
  6. Add a RavenController.cs class.

  7. Make AccountController.cs inherit from RavenController

    public class AccountController : RavenController
    {
    	...
    }