Esempio n. 1
0
        public void ConfigureOAuth(IAppBuilder app)
        {
            OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions()
            {
                AllowInsecureHttp         = true,
                TokenEndpointPath         = new PathString("/token"),
                AccessTokenExpireTimeSpan = TimeSpan.FromDays(1),
                Provider = new SimpleAuthorizationServerProvider()
            };

            // Token Generation
            app.UseOAuthAuthorizationServer(OAuthServerOptions);
            app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());

            CreateRoles.Execute();
            Seed.Execute();

            var bookRepo    = new BooksRepository();
            var libraryRepo = new LibrariesRepository();


            bookRepo.GetBookBorrowExpirations();
            SchedulerService.StartAction(24, bookRepo.GetBookBorrowExpirations);

            libraryRepo.GetMembershipExpirations();
            SchedulerService.StartAction(24, libraryRepo.GetMembershipExpirations);

            bookRepo.GetBookReservationExpirations();
            SchedulerService.StartAction(2, bookRepo.GetBookReservationExpirations);
        }