.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

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -