1

I need to create a web application that uses WIF to communicate with ADFS in order to login users. This web application supports multi-tenancy, accordingly, the same code base will be used to serve requests to site1.mydomain.com and site2.mydomain.com.

Currently, my WIF configuration is in the web.config file which is preventing me from achieving multi-tenancy. So I thought maybe there's a way to provide all the required WIF configuration through code by reading the host name from the request url and retrieving the tenant's configuration from the database instead of the web.config file.

Is that even possible? Any ideas or thoughts?

Kassem
  • 8,116
  • 17
  • 75
  • 116

1 Answers1

0

You migth get some ideas from this similar post : how do i move federated configuration out of the web config

AFAIK the FederationConfigurationCreated is called only once per application. This means that you will need to "wire" things like a custom securitytokenhandler, cookiehandler, certificatvalidator etc that do their work based on the current context. I would personally consider all of this "doable" but it migth take you 1 to 2 months to get all the sharp edges out of it. I mean, writing a securitytokenhandler is doable but it will be simpler when you have done so before. You will need to dive really deep in WIF and want to consider whether that is what you want.

As an alternative (that you probably don't want) you migth consider a deployment per tenant. Depending on the number and volatility of tenants this migth or migth not be a good idea.

Community
  • 1
  • 1