I am trying to implement CORS using Thinktecture.IdentityModel as mentioned in the link below:
http://brockallen.com/2012/06/28/cors-support-in-webapi-mvc-and-iis-with-thinktecture-identitymodel/
I tried Web API method and it didn’t work. So I went towards IIS route.
<system.webServer>
<modules runAllManagedModulesForAllRequests=“true“>
<add name=“MvcCorsHttpModule“
type=“Thinktecture.IdentityModel.Http.Cors.Mvc.MvcCorsHttpModule“/>
</modules>
</system.webServer>
And then again in global.asax you would configure the settings:
protected void Application_Start()
{
…
RegisterCors(MvcCorsConfiguration.Configuration);
}
private void RegisterCors(MvcCorsConfiguration corsConfig)
{
corsConfig
.ForResources(“Products.GetProducts”)
.ForOrigins(“http://foo.com”)
.AllowAll();
}
Now, it works in my local host (Windows 8, VS 2012) but when I push it to prod (IIS 6), it doesn’t work. Is there other settings to make it work in IIS 6? Why would it work in the localhost but not when I push it to production.