| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using System;
- using System.Configuration;
- using Abp.Owin;
- using Microsoft.Owin;
- using Microsoft.Owin.Cors;
- using Microsoft.Owin.Security.Cookies;
- using Owin;
- using WeApp;
- using WeApp.Api;
- using WeApp.Api.Controllers;
- using WeApp.Configuration;
- [assembly: OwinStartup(typeof(Startup))]
- namespace WeApp
- {
- 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 WeAppWebModule)
- //app.UseHangfireDashboard("/hangfire", new DashboardOptions
- //{
- // Authorization = new[] { new AbpHangfireAuthorizationFilter() } //You can remove this line to disable authorization
- //});
- }
- }
- }
|