GrayMint.Identity
1.0.1
See the version list below for details.
dotnet add package GrayMint.Identity --version 1.0.1
NuGet\Install-Package GrayMint.Identity -Version 1.0.1
<PackageReference Include="GrayMint.Identity" Version="1.0.1" />
<PackageVersion Include="GrayMint.Identity" Version="1.0.1" />
<PackageReference Include="GrayMint.Identity" />
paket add GrayMint.Identity --version 1.0.1
#r "nuget: GrayMint.Identity, 1.0.1"
#:package GrayMint.Identity@1.0.1
#addin nuget:?package=GrayMint.Identity&version=1.0.1
#tool nuget:?package=GrayMint.Identity&version=1.0.1
GrayMint.Identity
An OpenID Connect identity service for .NET that one deployment runs for many tenants. Accounts are kept by ASP.NET Core Identity and the protocol is OpenIddict's, both in one PostgreSQL database, with tenants built underneath both.
- Pools, tenants and applications. A pool is one product; a tenant is a set of accounts with its own host, which is its issuer; an application is a client of one tenant.
- Walls between tenants, in the database and at every request, each with a test that tries to cross it.
- Email and password sign-in, with sign-up and password reset by a mailed link, limits on guessing and mailing, and the most common passwords refused.
- Sign-in with Google for a tenant that has a client id there, with no secret and no script of Google's on the pages.
- Its own pages for all of that, in the tenant's name, drawn on the server and working without a script.
- The authorization code flow with PKCE, which gives an application an ID token, and sign-out.
- Keys outside the process: certificates in files and the key ring in the database, with a new signing certificate published before it signs.
- Accounts from Firebase keep their passwords.
Projects
| Project | What it is |
|---|---|
src/GrayMint.Identity |
The service, as a library: the GrayMint.Identity package on nuget.org |
src/GrayMint.Identity.Host |
The ready-to-run host and its commands |
tests/GrayMint.Identity.Test |
Tests that run the host against a real PostgreSQL and a real mail server |
Documents
- Design: how it is built, and the rules for changing it.
- Deployment: settings, certificates, setting up, and importing accounts.
Develop
You need the .NET 10 SDK and Docker.
docker compose up -d # PostgreSQL 18 on 127.0.0.1:5433, and a mail catcher on 127.0.0.1:1025
dotnet test
Each test makes a database of its own on that server and drops it when it ends. The mail catcher takes every mail and delivers none.
dotnet run --project src/GrayMint.Identity.Host starts the service at http://localhost:5280 with one
example tenant; its sign-in page is http://localhost:5280/account/sign-in. In Development it sets up its
database by itself, and makes its own certificates under the user's profile at the first start.
Its mails go to the mail catcher, where you read them at http://localhost:8025.
After a change to the model, add a migration:
dotnet ef migrations add <Name> --project src/GrayMint.Identity --startup-project src/GrayMint.Identity -o Persistence/Migrations
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.DataProtection.EntityFrameworkCore (>= 10.0.15)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 10.0.15)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 8.23.0)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.3)
- OpenIddict.EntityFrameworkCore (>= 7.9.0)
- OpenIddict.Server.AspNetCore (>= 7.9.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.