Skip to content

PaulTrampert/PTrampert.AspNetCore.Identity.MongoDB

Repository files navigation

PTrampert.AspNetCore.Identity.MongoDB

Dev Build: Build Status

MongoDB data store for AspNetCore.Identity.

Usage

Config file format:

{
    "DatabaseOptions": {
        "ConnectionString": "mongodb://localhost/",
        "Database": "testdb"
    },
    "UsersCollection": "users",
    "RolesCollection": "roles",
    "ManageIndicies": true
}

NOTE: The DatabaseOptions config section can be used with IdentityServer4.MongoDB.

IServiceCollection extensions:

AddMongoUserStore<T>(IConfiguration config)
AddMongoUserStore<T>(Action<MongoUserStoreOptions<T>> config)
AddMongoRoleStore<TRole>(IConfiguration config)
AddMongoRoleStore<TRole>(Action<MongoRoleStoreOptions<TRole> config)