.Net MVC Multi tenant URL Single sign on (SSO) -


i have application in .net core , multi tenant implementation follows:

tenants identified through url( www.example.com/tenant1 or www.example.com/tenant2).the tenants use shared database, i.e., data separated using id each tenant in each tables , each query usage tenantid fetch database corresponding each tenant.

i need implement sso in application , not able find solution url based multi-tenancy implementation sso.

so if user changes tenantname in url, , if valid user tenant, allowed else not.

i using cookie middleware authentication/authorization : https://docs.asp.net/en/latest/security/authentication/cookie.html

thanks suggestions.

you can accomplish via existing owin middlewares. extract url segment in middleware , find

  1. is current request authenticated
  2. if authenticated, logged in user having permission view data of tenant
  3. if (1) & (2) valid, pass request through other middlewares
  4. else, return unauthorized.

all takes custom middleware can add owin pipeline handle of magic.


Comments

Popular posts from this blog

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

testing - Detect whether test has failed within fixture -

android - Create single AAR file from multiple modules using Gradle -