.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
- is current request authenticated
- if authenticated, logged in user having permission view data of tenant
- if (1) & (2) valid, pass request through other middlewares
- else, return unauthorized.
all takes custom middleware can add owin pipeline handle of magic.
Comments
Post a Comment