asp.net - SAAS based mobile application -
we developing saas based mobile application in asp.net.
in our business domain have different companies , flows under those. each company has different url, when super admin create company on front end , parse url load each company specific logos , other settings.
we confused url management different companies. how should handle different sub domain urls hitting same physical location? , please share other guidelines must follow develop saas based web site.
identifying tenants url standard in developing saas applications.
it pretty easy , straight forward too. experience, suggest following
- configure iis site use root level domain (i.e. yourawesomeapp.com). makes subdomain request hit same site.
- store tenants url tenant1.yourawesomeapp.com, tenant2.yourawesomeapp.com, etc., in tenant table
- tell tenant use url access application
- write httpmodule, in postauthenticaterequest event grab current request url , verify tenanturlmapping entries (cache url <-> tenant mapping in dictionary @ application start improve performance)
- if request domain not in tenanturlmapping; deny access
- if request authenticated, verify authenticated tenant url/id sames current one, else deny access (tenant url/id can stored in cookie in encrypted format when logon)
- load required settings , store them in httpcontext.items use in later part of request.
Comments
Post a Comment