Ejemplo n.º 1
0
 protected async void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     IdentityConfig.RegisterIdentities();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     await InicializarWebApp.InicializarWeb(new Uri("http://localhost:59363"));
 }
Ejemplo n.º 2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public async void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddMvc();
            services.AddDbContext <SwLogDbContext>(options =>
                                                   options.UseSqlServer(Configuration.GetConnectionString("LogConnection")));

            await InicializarWebApp.Inicializar("WebAppTH");
        }
Ejemplo n.º 3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public async void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddMvc();
            services.AddSingleton <IApiServicio, ApiServicio>();
            await InicializarWebApp.InicializarWebRecursosMateriales("SwRecursosMateriales");

            await InicializarWebApp.InicializarWebTalentoHumano("SwTalentoHumano");
        }
Ejemplo n.º 4
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public async void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddMvc();
            services.AddSingleton <IBaseDatosServicio, BaseDatosServicio>();
            services.AddSingleton <IAdscSistServicio, AdscSistServicio>();
            services.AddSingleton <IApiServicio, ApiServicio>();
            services.AddResponseCaching();

            services.AddSingleton <IAdscpasswServicio, AdscpasswServicio>();
            await InicializarWebApp.InicializarWeb("SeguridadWebService", new Uri("http://localhost:4000"));

            await InicializarWebApp.InicializarLogEntry("LogWebService", new Uri("http://localhost:4000"));
        }
Ejemplo n.º 5
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public async void ConfigureServices(IServiceCollection services)
        {
            //services.AddIdentity<ApplicationUser,IdentityRole>(options=>
            //{



            //})

            //.AddDefaultTokenProviders();
            // Add framework services.
            services.AddMvc(

                );

            var appSettings = Configuration.GetSection("AppSettings");

            services.AddSingleton <IApiServicio, ApiServicio>();
            services.TryAddSingleton <IHttpContextAccessor, HttpContextAccessor>();

            services.AddAuthorization(options =>
            {
                options.AddPolicy("EstaAutorizado",
                                  policy => policy.Requirements.Add(new RolesRequirement()));
            });

            services.AddSingleton <IAuthorizationHandler, RolesHandler>();
            services.AddTransient <IEmailSender, AuthMessageSender>();
            services.AddTransient <ISmsSender, AuthMessageSender>();

            var ServicioSeguridad           = Configuration.GetSection("ServicioSeguridad").Value;
            var ServiciosLog                = Configuration.GetSection("ServiciosLog").Value;
            var ServicioTalentoHumano       = Configuration.GetSection("ServiciosTalentoHumano").Value;
            var ServiciosRecursosMateriales = Configuration.GetSection("ServiciosRecursosMateriales").Value;

            var HostSeguridad = Configuration.GetSection("HostServicioSeguridad").Value;

            WebApp.BaseAddressWebAppLogin = Configuration.GetSection("HostWebAppLogin").Value;

            await InicializarWebApp.InicializarWeb(ServicioTalentoHumano, new Uri(HostSeguridad));

            await InicializarWebApp.InicializarSeguridad(ServicioSeguridad, new Uri(HostSeguridad));

            await InicializarWebApp.InicializarWebRecursosMateriales(ServiciosRecursosMateriales, new Uri(HostSeguridad));

            await InicializarWebApp.InicializarLogEntry(ServiciosLog, new Uri(HostSeguridad));
        }
Ejemplo n.º 6
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public async void ConfigureServices(IServiceCollection services)
        {
            services.AddIdentity <ApplicationUser, IdentityRole>(options =>
            {
                options.Cookies.ApplicationCookie.LoginPath        = new PathString("/Login/Index");
                options.Cookies.ApplicationCookie.AccessDeniedPath = new PathString("/Login/Index");

                options.Cookies.ApplicationCookie.ExpireTimeSpan = TimeSpan.FromHours(2);
            })

            .AddDefaultTokenProviders();
            // Add framework services.
            services.AddMvc(

                );

            var appSettings = Configuration.GetSection("AppSettings");

            services.AddSingleton <IApiServicio, ApiServicio>();
            services.TryAddSingleton <IHttpContextAccessor, HttpContextAccessor>();

            services.AddAuthorization(options =>
            {
                options.AddPolicy("EstaAutorizado",
                                  policy => policy.Requirements.Add(new RolesRequirement()));
            });

            services.AddSingleton <IAuthorizationHandler, RolesHandler>();
            services.AddTransient <IEmailSender, AuthMessageSender>();
            services.AddTransient <ISmsSender, AuthMessageSender>();

            var ServicioSeguridad           = Configuration.GetSection("ServicioSeguridad").Value;
            var ServiciosLog                = Configuration.GetSection("ServiciosLog").Value;
            var ServicioTalentoHumano       = Configuration.GetSection("ServiciosTalentoHumano").Value;
            var ServiciosRecursosMateriales = Configuration.GetSection("ServiciosRecursosMateriales").Value;

            var HostSeguridad = Configuration.GetSection("HostServicioSeguridad").Value;

            await InicializarWebApp.InicializarWeb(ServicioTalentoHumano, new Uri(HostSeguridad));

            await InicializarWebApp.InicializarSeguridad(ServicioSeguridad, new Uri(HostSeguridad));

            await InicializarWebApp.InicializarWebRecursosMateriales(ServiciosRecursosMateriales, new Uri(HostSeguridad));

            await InicializarWebApp.InicializarLogEntry(ServiciosLog, new Uri(HostSeguridad));
        }
Ejemplo n.º 7
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public async void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddMvc();
            services.AddSingleton <IApiServicio, ApiServicio>();

            var ServicioSeguridad           = Configuration.GetSection("ServicioSeguridad").Value;
            var ServiciosLog                = Configuration.GetSection("ServiciosLog").Value;
            var ServicioTalentoHumano       = Configuration.GetSection("ServiciosTalentoHumano").Value;
            var ServiciosRecursosMateriales = Configuration.GetSection("ServiciosRecursosMateriales").Value;

            var HostSeguridad = Configuration.GetSection("HostServicioSeguridad").Value;
            await InicializarWebApp.InicializarWebRecursosMateriales(ServiciosRecursosMateriales, new Uri(HostSeguridad));

            await InicializarWebApp.InicializarSeguridad(ServicioSeguridad, new Uri(HostSeguridad));

            await InicializarWebApp.InicializarWebTalentoHumano(ServicioTalentoHumano, new Uri(HostSeguridad));

            await InicializarWebApp.InicializarLogEntry(ServiciosLog, new Uri(HostSeguridad));
        }
Ejemplo n.º 8
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public async void ConfigureServices(IServiceCollection services)
 {
     // Add framework services.
     services.AddMvc();
     await InicializarWebApp.Inicializar("WebAppTH");
 }