GithubHelp home page GithubHelp logo

panoukos41 / couchdb-identity Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 100 KB

CouchDB Storage Provider for ASP.NET Core Identity

License: MIT License

C# 99.80% PowerShell 0.13% Shell 0.07%
couchdb identity aspnetcore csharp dotnet

couchdb-identity's Introduction

AspNetCore.Identity.CouchDB

Release NuGet License

CouchDB identity store provider for the ASP.NET Core Identity using CouchDB.NET.

The UserStore implements the following Interfaces:

  • IQueryableUserStore
  • IUserStore
  • IUserPasswordStore
  • IUserSecurityStampStore
  • IUserEmailStore
  • IUserPhoneNumberStore
  • IUserRoleStore
  • IUserClaimStore
  • IUserLoginStore
  • IUserTwoFactorStore
  • IUserAuthenticatorKeyStore
  • IUserLockoutStore

The RoleStore implements the following Interfaces:

  • IQueryableRoleStore
  • IRoleStore
  • IRoleClaimStore

The project was insipired from the existing AspNetCore.Identity.Cassandra implementation.

Before Getting started

This project was made in a hurry and was live tested on a really simple application so some things might not work as expected. Feel free to open an issue and even a pull request.

I will try my best to support the project and provide tests and samples whenever i find time.

Thanks for looking at this library ๐Ÿ˜„

Getting Started

By default a database named identity is used but you can change it using the options overload.

Your CouchDB database must implement the ddoc.json in the ddocs folder.

At your Startup.cs add your ICouchClient in DI and use the following code.

using AspNetCore.Identity.CouchDB.Models;

// Configure Identity stores and services.
services.AddIdentity<CouchDbUser, CouchDbRole>()
        .AddCouchDbStores();

Or you can provide your own instance of ICouchClient in the options.

// Configure Identity stores and services.
// With custom client.
services.AddIdentity<CouchDbUser, CouchDbRole>()
        .AddCouchDbStores(options => options
            .UseClient(new CouchClient("http://localhost:5984")));

You can also customize the design document and views used by the library. More information as to what a view returns and when can be found in the ddocs fodler.

services.AddIdentity<CouchDbUser, CouchDbRole>()
        .AddCouchDbStores(options => options
            .UseViewOptions(new CouchDbViewOptions
            {
                Document = "identity";
                User = "user";
                UserNormalizedUsername = "user.normalized_username";
                UserNormalizedEmail = "user.normalized_email";
                UserRolesNormalizedName = "user.roles.normalized_name";
                UserClaims = "user.claims";
                UserLogins = "user.logins";
                Role = "role";
                RoleNormalizedName = "role.normalized_name";
            })));

Services are registered as Singleton since ICouchClient is/should be registered as such and no other dependency is needed.

LICENSE

The project is Licensed under the MIT License see the LICENSE for more info.

couchdb-identity's People

Contributors

panoukos41 avatar

Watchers

 avatar

couchdb-identity's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.