Last post Apr 09, 2015 04:08 AM by gtscdsi
Mar 17, 2015 03:02 PM|tomkmvp|LINK
I want to write a web app that depending on the URL requested sets the authentication method. For example, if a user browses to form.myapp.com, they will be prompted to login via forms based authentication. If the user browses to sso.myapp.com, they hit
the same site and code base, but are then directed to use SSO as their auth method.
What event in global.asax would be used to catch this? (assuming that's the way to do it) Or is there a better way? What objects do I need to manipulate to set the auth method used?
Is this even possible or do I need to setup a separate code base/web app for each auth method?
I would like to use ASP.NET Identity for all of this.
Apr 02, 2015 10:21 AM|gtscdsi|LINK
IIS supports multiple website/webapp mapping same physical file. For example, you can create 2 websites in IIS server, one is for form.myapp.com, the other one for sso.myapp.com. But all 2 sites point to physical path c:\inetpub\wwwroot\myapp.
Then, one website can enable Windows Authentication, and the other website can enable Forms based authentication.
Apr 02, 2015 10:32 AM|tomkmvp|LINK
Thanks for the response, but this does not actually answer my question. I understand how to configure IIS to host multiple sites on the same physical path, my question is code oriented. I need code ideas on how to set the ASP.NET authentication settings
based upon the URL being accessed.
Apr 09, 2015 04:08 AM|gtscdsi|LINK
If you like to perform your own authentication, you can implement a IHttpModule. In there, you can check request URL and autheticate the coming request accordingly. However, it seems no way to change ASP.NET authentication setting dynamically.