예제 #1
0
 public ManageController(
     UserManagerService userManager,
     SignInManagerService signInManager)
 {
     this.userManager   = userManager;
     this.signInManager = signInManager;
 }
        public UserAuthenticationService(
            IdentityDbService context,
            IdentityService identityService,
            CurrentUserService currentUserService,
//#??must confugured for dep inj
            UserManagerService <IAppUser> userManager,
            SignInManagerService <IAppUser> signInManager)
        {
            _context            = context;
            _identityService    = identityService;
            _userManager        = userManager;
            _signInManager      = signInManager;
            _currentUserService = currentUserService;
        }
예제 #3
0
 public TopicsController()
 {
     this.topicsService        = new TopicsService();
     this.signInManagerService = new SignInManagerService();
 }
예제 #4
0
        public void Configuration(IAppBuilder app)
        {
            var ioc = UnityConfig.Container;

            // Setup Hangfire
            GlobalConfiguration
            .Configuration
            .UseStorage(new MySqlStorage("DefaultHangfireConnection"));

            GlobalConfiguration
            .Configuration
            .UseActivator(new ContainerJobActivator(UnityConfig.ContainerHangfire));

            var options = new DashboardOptions
            {
                AuthorizationFilters = new List <IAuthorizationFilter>
                {
                    new AuthorizationFilter {
                        Roles = "Admin"
                    },
                    new ClaimsBasedAuthorizationFilter("name", "value")
                }
            };

            app.UseHangfireDashboard("/hangfire", options);
            app.UseHangfireServer();

            // Configure the db context to use a single instance per request
            app.CreatePerOwinContext(() =>
            {
                return(ioc.Resolve <ApplicationDbContext>());
            });

            // Configure the signin manager to use a single instance per request
            app.CreatePerOwinContext <UserManagerService>((o, c) =>
            {
                var u = ioc.Resolve <IUserStore <ApplicationUser> >();

                var m = new UserManagerService(
                    u,
                    o,
                    ioc.Resolve <IIdentityMessageService>("IdentityMsgSvcEmail"),
                    ioc.Resolve <IIdentityMessageService>("IdentityMsgSvcSMS"),
                    ioc.Resolve <ISettingsService>());
                return(m);
            });

            // Configure the user manager to use a single instance per request
            app.CreatePerOwinContext <SignInManagerService>((o, c) =>
            {
                var m = new SignInManagerService(
                    c.GetUserManager <UserManagerService>(),
                    c.Authentication,
                    ioc.Resolve <ISettingsService>());

                return(m);
            });

            var authorizationService = ioc.Resolve <IAuthorizationService>();

            authorizationService.Setup(app);

            // Use hangfire to fetch data periodically
            RecurringJob.AddOrUpdate(
                "MovieListUpdateService",
                () => RunMovieListUpdateService(new Hangfire.JobCancellationToken(false)),
                Cron.Daily
                );
        }
예제 #5
0
 public CategoriesController()
 {
     this.categoriesService    = new CategoriesService();
     this.signInManagerService = new SignInManagerService();
 }
 public ForumController()
 {
     this.forumService         = new ForumService();
     this.signInManagerService = new SignInManagerService();
 }
예제 #7
0
 public SignInManagerServicesTest()
 {
     signInManagerService = GetService <SignInManagerService>();
 }