using Microsoft.Owin.Security.OAuth; using System.Web.Http; using ThirdPartyAPIs.CustomFilter; namespace ThirdPartyAPIs { public static class WebApiConfig { public static void Register(HttpConfiguration config) { // Web API configuration and services Configure Web API to use only bearer token authentication. config.SuppressDefaultHostAuthentication(); config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType)); // Web API routes config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional } ); //config.Filters.Add(new ApplicationAuthenticationFilter()); config.Filters.Add(new ApplicationExceptionLogFilter()); //config.Filters.Add(new ValidationActionFilter()); } } }