| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using System.Configuration;
- using Abp.Owin;
- using Microsoft.Owin;
- using Microsoft.Owin.Cors;
- using Microsoft.Owin.Security.Cookies;
- using Owin;
- using WeEngine;
- using WeEngine.Api;
- using WeEngine.Api.Controllers;
- [assembly: OwinStartup(typeof(Startup))]
- namespace WeEngine
- {
- public class Startup
- {
- public void Configuration(IAppBuilder app)
- {
- app.UseAbp();
- app.UseCors(CorsOptions.AllowAll);
- app.UseOAuthBearerAuthentication(AccountController.OAuthBearerOptions);
- app.UseCookieAuthentication(new CookieAuthenticationOptions
- {
- AuthenticationType = WeEngineAuthenticationTypes.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(WeEngineAuthenticationTypes.ExternalCookie);
- app.UseOAuthAuthorizationServer(OAuthOptions.CreateServerOptions());
- //app.MapSignalR();
- //ENABLE TO USE HANGFIRE dashboard (Requires enabling Hangfire in WeEngineWebModule)
- //app.UseHangfireDashboard("/hangfire", new DashboardOptions
- //{
- // Authorization = new[] { new AbpHangfireAuthorizationFilter() } //You can remove this line to disable authorization
- //});
- }
- }
- }
|