using System; using System.Configuration; using Abp.Owin; using Microsoft.Owin; using Microsoft.Owin.Cors; using Microsoft.Owin.Security.Cookies; using Owin; using WeOnlineApp; using WeOnlineApp.Api; using WeOnlineApp.Api.Controllers; using WeOnlineApp.Configuration; [assembly: OwinStartup(typeof(Startup))] namespace WeOnlineApp { public class Startup { public void Configuration(IAppBuilder app) { app.UseAbp(); app.UseCors(CorsOptions.AllowAll); app.UseOAuthBearerAuthentication(AccountController.OAuthBearerOptions); app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = IwbAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Account/Index"), // by setting following values, the auth cookie will expire after the configured amount of time (default 14 days) when user set the (IsPermanent == true) on the login ExpireTimeSpan = new TimeSpan(int.Parse(ConfigurationManager.AppSettings["AuthSession.ExpireTimeInDays.WhenPersistent"] ?? "14"), 0, 0, 0), SlidingExpiration = bool.Parse(ConfigurationManager.AppSettings["AuthSession.SlidingExpirationEnabled"] ?? bool.TrueString), //SessionStore = new IwbAuthenticationSessionStore() }); app.UseExternalSignInCookie(IwbAuthenticationTypes.ExternalCookie); app.UseOAuthAuthorizationServer(OAuthOptions.CreateServerOptions()); app.MapSignalR(); //ENABLE TO USE HANGFIRE dashboard (Requires enabling Hangfire in WeOnlineAppWebModule) //app.UseHangfireDashboard("/hangfire", new DashboardOptions //{ // Authorization = new[] { new AbpHangfireAuthorizationFilter() } //You can remove this line to disable authorization //}); } } }