GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - alansferreira/AspNet.Identity.LiteDB: LiteDB Authentication Implementation Provider for AspNet Idendity

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
Properties
Properties
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
AspNet.Identity.LiteDB.csproj
AspNet.Identity.LiteDB.csproj
 
 
IdentityRole.cs
IdentityRole.cs
 
 
IdentityUser.cs
IdentityUser.cs
 
 
IdentityUserClaim.cs
IdentityUserClaim.cs
 
 
IndexChecks.cs
IndexChecks.cs
 
 
LICENSE
LICENSE
 
 
LiteDB.AspNet.Identity.nuspec
LiteDB.AspNet.Identity.nuspec
 
 
LiteDB.AspNet.Identity.sln
LiteDB.AspNet.Identity.sln
 
 
README.md
README.md
 
 
RoleStore.cs
RoleStore.cs
 
 
UserStore.cs
UserStore.cs
 
 
Utils.cs
Utils.cs
 
 
packages.config
packages.config
 
 

Repository files navigation

AspNet.Identity.LiteDB

This library was constructed based on the MongoDB.AspNet.Identity.

ASP.NET Identity provider that users LiteDB for storage

Purpose

ASP.NET MVC 5 shipped with a new Identity system (in the Microsoft.AspNet.Identity.Core package) in order to support both local login and remote logins via OpenID/OAuth, but only ships with an Entity Framework provider (Microsoft.AspNet.Identity.EntityFramework).

News

Features

  • Drop-in replacement ASP.NET Identity with LiteDB as the backing store.
  • Requires only 1 LiteDb document type, while EntityFramework requires 5 tables
  • Contains the same IdentityUser class used by the EntityFramework provider in the MVC 5 project template.
  • Supports additional profile properties on your application's user model.
  • Provides UserStore implementation that implements the same interfaces as the EntityFramework version:
    • IUserStore
    • IUserLoginStore
    • IUserRoleStore
    • IUserClaimStore
    • IUserPasswordStore
    • IUserSecurityStampStore

Instructions

These instructions assume you know how to set up LiteDB 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 LiteDB Identity:
Uninstall-Package Microsoft.AspNet.Identity.EntityFramework
Uninstall-Package EntityFramework
Install-Package LiteDB.AspNet.Identity
  1. In ~/Models/IdentityModels.cs:
    • Remove the namespace: Microsoft.AspNet.Identity.EntityFramework
    • Add the namespace: AspNet.Identity.LiteDB
    • Remove the ApplicationDbContext class completely.
  2. In ~/Controllers/AccountController.cs
    • Remove the namespace: Microsoft.AspNet.Identity.EntityFramework
    • Add the connection string name to the constructor of the UserStore. Or empty constructor will use DefaultConnection
public AccountController()
{
    this.UserManager = new UserManager<ApplicationUser>(
        new UserStore<ApplicationUser>("myDb.data");
    // OR 
    this.UserManager = new UserManager<ApplicationUser>(
        new UserStore<ApplicationUser>("DefaultConnection");
}

Connection Strings

The UserStore has multiple constructors for handling connection strings. Here are some examples of the expected inputs and where the connection string should be located.

1. SQL Style

UserStore(string connectionNameOrPath)

UserStore("LiteDBUsers")

web.config

<add name="LiteDBUsers" connectionString="{YourDataBaseFile}" />

OR

UserStore(string connectionNameOrPath)

UserStore("{YourDataBaseFile}")

Thanks To

Special thanks to MaxiomTech InspectorIT project gave me the base for jumpstarting the LiteDB provider

About

LiteDB Authentication Implementation Provider for AspNet Idendity

Resources

Readme
MIT license
Activity

Stars

4 stars

Watchers

2 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.