I have an ASP.Net MVC4 intranet site that also has a Web API controller.
I have set Authentication = "Windows" in the web.config.
Is it possible to set the Web API only to allow Anonymous?
** Changes I've made to the WebApiConfig file per suggestions below.
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
// Web API routes
config.MapHttpAttributeRoutes();
config.SuppressDefaultHostAuthentication();
config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
}
}