RavenDB.AspNet.Identity 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package RavenDB.AspNet.Identity --version 2.0.0
NuGet\Install-Package RavenDB.AspNet.Identity -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RavenDB.AspNet.Identity" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RavenDB.AspNet.Identity --version 2.0.0
#r "nuget: RavenDB.AspNet.Identity, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RavenDB.AspNet.Identity as a Cake Addin
#addin nuget:?package=RavenDB.AspNet.Identity&version=2.0.0

// Install RavenDB.AspNet.Identity as a Cake Tool
#tool nuget:?package=RavenDB.AspNet.Identity&version=2.0.0

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

These instructions assume you know how to set up RavenDB within an MVC application.

  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) 
     {
     	// Update this line to pass in the Raven document session:
     	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 base class.

  7. Make AccountController.cs inherit from RavenController

     public class AccountController : RavenController
     {
     	...
     }
    
Product Compatible and additional computed target framework versions.
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on RavenDB.AspNet.Identity:

Package Downloads
BrickPile

BrickPile is a lightweight CMS built on RavenDB and ASP.NET MVC 5

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.1 3,964 2/6/2019
2.0.0 2,401 3/19/2018
1.0.2.2 1,794 9/22/2017
1.0.2.1 1,062 8/17/2017
1.0.2 1,320 11/15/2016
1.0.1 1,067 8/16/2016
0.9.1 2,290 4/3/2015
0.9.0 2,479 10/25/2013