Micro Multi Tenanted Value Resolver Library

· 1 min

I've recently been adding multi-tenancy to a full-stack application with an ASP.NET Core back end. The multi-tenant libraries I looked at had one or more of these problems:

Many of them also load credentials from configuration files or a resolution database. I don't like that. Why?

Most credentials don't belong in files like appsettings.json. They belong in a key vault, such as Azure Key Vault, which brings permission management, hardware-level encryption and more.

So I wrote a very, very small library. It's middleware that resolves the tenant for each request and pushes that tenant's credentials into the current HttpContext. It's available as a NuGet package.

A nice thing about Azure Key Vault is that all secrets, subject to access rights, can be loaded into IConfiguration when the application builds.

The source and more information are on GitHub.