All Projects → gpeipman → Aspnetcoremultitenant

gpeipman / Aspnetcoremultitenant

Multitenant ASP.NET Core application to serve as a starting point for real multitenant applications

Projects that are alternatives of or similar to Aspnetcoremultitenant

Simple aspnet auth
Simple ASP.NET Authorisation boilerplate project. No EF, no database, no IdentityServer4 just a basic logging in system for both cookies and JWT and a controller with a set of examples.
Stars: ✭ 105 (-21.64%)
Mutual labels:  aspnetcore
Samples.aspnetcore Identityserver4
IdentityServer4 sample with .NET Core and ASP.NET Core 2.0
Stars: ✭ 115 (-14.18%)
Mutual labels:  aspnetcore
Active Directory Dotnet Webapp Webapi Openidconnect Aspnetcore
An ASP.NET Core web application that authenticates Azure AD users and calls a web API using OAuth 2.0 access tokens.
Stars: ✭ 124 (-7.46%)
Mutual labels:  aspnetcore
Aspnetcore.efcore dapper
Projeto ASP.NET Core + Entity Framework Core + Dapper, demonstrando o uso de ambos separadamente e em um cenário híbrido.
Stars: ✭ 105 (-21.64%)
Mutual labels:  aspnetcore
Comboost
ComBoost是一个领域驱动的快速开发框架
Stars: ✭ 111 (-17.16%)
Mutual labels:  aspnetcore
Aspnetcore.identity.mongodbcore
A MongoDb UserStore and RoleStore adapter for Microsoft.AspNetCore.Identity 2.2. Allows you to use MongoDb instead of SQL server with Microsoft.AspNetCore.Identity 2.2. (not Identity 3.0)
Stars: ✭ 118 (-11.94%)
Mutual labels:  aspnetcore
Aspnet Core React Registration Login Example
React + ASP.NET Core 2.0 - User Registration and Login Example & Tutorial
Stars: ✭ 102 (-23.88%)
Mutual labels:  aspnetcore
Elmahcore
ELMAH for Net.Standard and Net.Core
Stars: ✭ 127 (-5.22%)
Mutual labels:  aspnetcore
Browserinterop
Wrapper for Browser JS API for Blazor and JSInterop
Stars: ✭ 112 (-16.42%)
Mutual labels:  aspnetcore
Openiddict Core
Versatile OpenID Connect stack for ASP.NET Core and Microsoft.Owin (compatible with ASP.NET 4.6.1)
Stars: ✭ 2,275 (+1597.76%)
Mutual labels:  aspnetcore
Aspnet.security.openid.providers
OpenID 2.0 authentication middleware for ASP.NET Core
Stars: ✭ 107 (-20.15%)
Mutual labels:  aspnetcore
Aspnetcore Angular Universal
ASP.NET Core & Angular Universal advanced starter - PWA w/ server-side rendering for SEO, Bootstrap, i18n internationalization, TypeScript, unit testing, WebAPI REST setup, SignalR, Swagger docs, and more! By @TrilonIO
Stars: ✭ 1,455 (+985.82%)
Mutual labels:  aspnetcore
Websockets
WebSockets Inception
Stars: ✭ 120 (-10.45%)
Mutual labels:  aspnetcore
Elect
The collection of utilities, best practice and fluent method for .NET Core
Stars: ✭ 107 (-20.15%)
Mutual labels:  aspnetcore
Graphqlcore
Learn how to implement scalable APIs with GraphQL and ASP.NET Core. Branch wise code with relevant topic for smooth and easy walkthrough.
Stars: ✭ 125 (-6.72%)
Mutual labels:  aspnetcore
Dotnet Unpkg
Pure .NET front-end HTML package management using unpkg.com as a source
Stars: ✭ 103 (-23.13%)
Mutual labels:  aspnetcore
Neventlite
NEventLite - An extensible lightweight library for .NET that manages the Aggregate lifecycle in an Event Sourced system. Supports Event and Snapshot storage providers like EventStore/Redis or SQL Server. Built with dependency injection in mind and seamlessly integrates with AspNetCore.
Stars: ✭ 117 (-12.69%)
Mutual labels:  aspnetcore
Abp.grpc
基于 ABP 框架开发的 Grpc 模块,支持 Consul 服务发现与服务注册。Grpc module developed based on ABP framework supports early service discovery and service registration.
Stars: ✭ 134 (+0%)
Mutual labels:  aspnetcore
Toss.blazor
Experimental project using AspNetCore Blazor
Stars: ✭ 126 (-5.97%)
Mutual labels:  aspnetcore
Recaptcha.aspnetcore
Google reCAPTCHA v2/v3 for .NET Core 3.x
Stars: ✭ 122 (-8.96%)
Mutual labels:  aspnetcore

Multi-tenant ASP.NET Core

This is demo project for my Multi-tenant ASP.NET Core presentation. It demonstrates multi-tenant solutions I have worked out for ASP.NET Core. I'm using the same demo also for presentations. Solutions provided here are not absolute truth. There are cases when something different is needed and then the code here serves as a good starting point.

Features

There are multiple features and solutions demonstrated in demo application:

Setting every thing up

To demonstrate multi-tenant features I have built I'm using SQL Server LocalDB and MySQL databases. SQL Server LocalDB uses integrated security. For MySQL some user account is needed to access database. Those who plan to run this example on Linux must use some Linux version of SQL Server or SQL Server running on some other machine.

There are two web applications in the solution:

  • AspNetCoreMultitenant.Web - safe multitenant web application to use as an example and starting point
  • AspNetCoreMultitenant.WebDangerous - dangerous approach to shared resources (shared database tables)

AspNetCoreMultitenant.Web defines three tenants:

  • bigcorp - uses dedicated MySQL database
  • sme1 - uses SQL Server database
  • sme2 - uses SQL Server database

AspNetCoreMultitenant.WebDangerous defines two tenants:

  • sme1 - uses same SQL Server database as sme2
  • sme2 - uses same SQL Server database as sme1

There are also some host name mappings needed to run this demo on local machine:

  • 127.0.0.1 bigcorp
  • 127.0.0.1 sme1
  • 127.0.0.1 sme2

Web application uses port 5000 and it must be added to URL of all tenants:

Dangerous web application uses port 5001 and it must be added to URL of all tenants:

When using public server to host this application make sure you turn on HTTPS in application startup.

Concepts

This solution has some important concepts to know:

  • Tenant source - class that knows how to read tenant definitions from tenants store
  • Tenant provider - class that knows how to find current tenant
  • Dynamic cache key provider - class that provides EF Core with caching keys for DbContext model
  • Missing tenant middleware - ASP.NET Core request pipeline middleware that acts when tenant is not found
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].