Skip to content

JohnCampionJr/MongoFramework.AspNetCore.Identity

Folders and files

NameName
Last commit message
Last commit date
Jul 23, 2023
Jul 7, 2023
Aug 19, 2024
Jul 7, 2023
Jul 7, 2023
Dec 19, 2020
Oct 22, 2020
Jul 7, 2023
Oct 22, 2020
Jul 7, 2023
Jul 7, 2023
Dec 19, 2020
Oct 22, 2020

Repository files navigation

Actions Status Codacy Badge codecov

MongoFramework.AspNetCore.Identity

.Net Core Identity providers for MongoFramework.

Features

MongoFramework Implementations

  • IdentityUser
  • IdentityRole
  • RoleStore
  • UserStore
  • UserOnlyStore

ServiceCollection Extensions for

  • MongoDbContext
services.AddMongoDbContext<MongoDbContext>(o =>
    o.ConnectionString = Configuration.GetConnectionString("DefaultConnection"));
  • Identity Stores (adds to IdentityBuilder)
services.AddDefaultIdentity<MongoIdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
    .AddMongoFrameworkStores<MongoDbContext>();
  • Complete Identity (User Only)
services.AddMongoDbContext<MongoDbContext>(o =>
    o.ConnectionString = Configuration.GetConnectionString("DefaultConnection"));

services.AddDefaultMongoIdentity<MongoIdentityUser, MongoDbContext>();
  • Complete Identity (Users and Roles)
services.AddMongoDbContext<MongoDbContext>(o =>
    o.ConnectionString = Configuration.GetConnectionString("DefaultConnection"));

services.AddMongoIdentity<MongoIdentityUser, MongoIdentityRole, MongoDbContext>();

Sample .NET Core Project

Unit Tests, including passing Asp.Net Core's IdentitySpecificationBase

IdentitySpec Tests

This issue shows the spec tests weren't publicly released for .NET 5.0. They are supposed to be, but do not show up on NuGet yet. I have added the code manually to the test project until this gets published.