2017-01-06 10:02:36 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Net.Http;
|
|
|
|
|
using System.Web.Http;
|
|
|
|
|
using Microsoft.Owin.Security.OAuth;
|
|
|
|
|
using Newtonsoft.Json.Serialization;
|
|
|
|
|
|
2017-04-02 04:11:35 -04:00
|
|
|
|
namespace securecall
|
2017-01-06 10:02:36 -05:00
|
|
|
|
{
|
|
|
|
|
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.EnableCors();
|
|
|
|
|
config.SuppressDefaultHostAuthentication();
|
|
|
|
|
config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
|
|
|
|
|
|
|
|
|
|
// Web API routes
|
|
|
|
|
config.MapHttpAttributeRoutes();
|
|
|
|
|
|
|
|
|
|
config.Routes.MapHttpRoute(
|
|
|
|
|
name: "DefaultApi",
|
|
|
|
|
routeTemplate: "api/{controller}/{id}",
|
|
|
|
|
defaults: new { id = RouteParameter.Optional }
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|