Quantcast
Channel: Configuration and Deployment
Viewing all articles
Browse latest Browse all 3561

Different web.configs for the same project depending on which site is requested

$
0
0

In my web application I want two different authentication modes. Windows and Forms.

What I'm trying to achieve:

For irrelevant reasons I need to set up two different sites in IIS. One site is using Windows Authentication the other one Forms. I want the sites to be mapped to the same project. The only difference should be the web.config file, simply put one line:

Web.config 1

<authentication mode="Forms" />
<authorization>
<deny users="?" />
</authorization>
Web.config 2

<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
An easy solution would be to simple have two sites mapped to two identical projects, containing different configs. Although, this could cause problems/difficulties in the future regarding maintenance, since one has to remember to publish new changes to both of the projects.

"If a client tries to enter site 1 with url XXX they should be prompted the Windows Autentication (configured in browser to support SSO). If a client tries to enter site 2 with url yyy they should be prompted to enter credentials for a SQL user in a form login."

Is it somehow possible to achieve my desire without having two identical projects?

Regards,
ChrisRunn


Viewing all articles
Browse latest Browse all 3561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>