Last post Nov 10, 2014 04:43 PM by MarkAJones
Nov 07, 2014 10:57 AM|MarkAJones|LINK
Hi there, I have an almost working solution, that is thwarted by a lack of data initialization, hope someone can help
We want to have a single instance of an ASP.NET website on the disk
but multiple Host headers mapping to the site. The idea is that the Css and images maybe different for each one, but the application is the same
The asp.net site is .NET 4.5 with claims based authentication
thus in the web.config we have <identityConfiguration and <federationConfiguration settings that we would want to configure differently for each host header.
(each instance may have it's own trusted issuer, but certainly the realm and reply parameters have to change so that the Identity provider can return to the correct site !)
The Web.config schema allows for multiple <identityConfiguration and <federationConfiguration as long as there is one set that is unnamed (as default) and each additional
set has it's own name= attribute. .NET federation ignores the named ones, and loads the default.
I wrote an httpModule - that adds a handler to FederationConfigurationCreated event (the only event that seems related to the federation authentication)
When this fires, I want to see if the loaded FederationConfiguration has the same name as the current host ( HttpContext.Current.Request.Headers("Host") )
and if not, load the section with that host name
If e.FederationConfiguration.Name <> lsCurrentHost Then
e.FederationConfiguration = New System.IdentityModel.Services.Configuration.FederationConfiguration(lsCurrentHost)
e.FederationConfiguration.IdentityConfiguration = New System.IdentityModel.Configuration.IdentityConfiguration(lsCurrentHost)
The problem is the Host is always 127.0.0.1
all the Request.Headers are blank or uninitialized
Is there a better approach ?
how can I get the current.Request headers initialized properly ?
Nov 09, 2014 09:09 PM|LemonStreet|LINK
Hope the following links help:
Nov 10, 2014 04:43 PM|MarkAJones|LINK
Which part in particular do you think would help initialize the Headers ?