3d147b3a8d04c478fc230b707bb146670be0b33a
RavenDB.Identity
The simple and easy Identity provider for RavenDB and ASP.NET Core. Use Raven to store your users and logins.
Instructions
- Add an AppUser class that derives from Raven.Identity.IdentityUser:
public class AppUser : Raven.Identity.IdentityUser
{
/// <summary>
/// A user's full name.
/// </summary>
public string FullName { get; set; }
}
- In Startup.cs:
public void ConfigureServices(IServiceCollection services)
{
// Grab our RavenSettings object from appsettings.json.
services.Configure<RavenSettings>(Configuration.GetSection("RavenSettings"));
// Add RavenDB and identity.
services
.AddRavenDbDocStore() // Create an IDocumentStore singleton from the RavenSettings.
.AddRavenDbAsyncSession() // Create a RavenDB IAsyncDocumentSession for each request. docStore is your IDocumentStore instance. You're responsible for calling .SaveChanges after each request.
.AddRavenDbIdentity<AppUser>(); // Use Raven to manage users and roles.
...
}
- In your controller actions, call .SaveChanges when you're done making changes. Typically this is done via a RavenController base class for MVC/WebAPI projects, or via an ActionFilter for Razor Pages projects.
Need help? See the sample app to see it all in action.
Not using .NET Core? See our sister project for a RavenDB Identity Provider for MVC 5+ and WebAPI 2+ on the full .NET Framework.
Description
RavenDB Identity provider for ASP.NET Core. Let RavenDB manage your users and logins.
Languages
C#
100%