2017-01-06 10:02:36 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using Microsoft.Owin;
|
|
|
|
|
using Owin;
|
|
|
|
|
using System.Web.Http;
|
|
|
|
|
using Microsoft.Owin.Security.ActiveDirectory;
|
|
|
|
|
using System.IdentityModel.Tokens;
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
|
2017-04-02 04:11:35 -04:00
|
|
|
|
[assembly: OwinStartup(typeof(securecall.Startup))]
|
2017-01-06 10:02:36 -05:00
|
|
|
|
|
2017-04-02 04:11:35 -04:00
|
|
|
|
namespace securecall
|
2017-01-06 10:02:36 -05:00
|
|
|
|
{
|
|
|
|
|
public partial class Startup
|
|
|
|
|
{
|
|
|
|
|
public void Configuration(IAppBuilder app)
|
|
|
|
|
{
|
|
|
|
|
HttpConfiguration config = new HttpConfiguration();
|
|
|
|
|
|
|
|
|
|
ConfigureAuthNew(app);
|
|
|
|
|
|
|
|
|
|
WebApiConfig.Register(config);
|
|
|
|
|
app.UseWebApi(config);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ConfigureAuthNew(IAppBuilder app)
|
|
|
|
|
{
|
|
|
|
|
app.UseWindowsAzureActiveDirectoryBearerAuthentication(
|
|
|
|
|
new WindowsAzureActiveDirectoryBearerAuthenticationOptions
|
|
|
|
|
{
|
|
|
|
|
TokenValidationParameters = new TokenValidationParameters
|
|
|
|
|
{
|
|
|
|
|
ValidAudience = ConfigurationManager.AppSettings["Audience"]
|
|
|
|
|
},
|
|
|
|
|
Tenant = ConfigurationManager.AppSettings["Tenant"]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|