Пример #1
0
 public CodeZeroUserClaimsPrincipalFactory(
     CodeZeroUserManager <TRole, TUser> userManager,
     CodeZeroRoleManager <TRole, TUser> roleManager,
     IOptions <IdentityOptions> optionsAccessor
     ) : base(userManager, roleManager, optionsAccessor)
 {
 }
        public CodeZeroLogInManager(
            CodeZeroUserManager <TRole, TUser> userManager,
            IMultiTenancyConfig multiTenancyConfig,
            IRepository <TTenant> tenantRepository,
            IUnitOfWorkManager unitOfWorkManager,
            ISettingManager settingManager,
            IRepository <UserLoginAttempt, long> userLoginAttemptRepository,
            IUserManagementConfig userManagementConfig,
            IIocResolver iocResolver,
            IPasswordHasher <TUser> passwordHasher,
            CodeZeroRoleManager <TRole, TUser> roleManager,
            CodeZeroUserClaimsPrincipalFactory <TUser, TRole> claimsPrincipalFactory)
        {
            _passwordHasher            = passwordHasher;
            _claimsPrincipalFactory    = claimsPrincipalFactory;
            MultiTenancyConfig         = multiTenancyConfig;
            TenantRepository           = tenantRepository;
            UnitOfWorkManager          = unitOfWorkManager;
            SettingManager             = settingManager;
            UserLoginAttemptRepository = userLoginAttemptRepository;
            UserManagementConfig       = userManagementConfig;
            IocResolver = iocResolver;
            RoleManager = roleManager;
            UserManager = userManager;

            ClientInfoProvider = NullClientInfoProvider.Instance;
        }
Пример #3
0
        public CodeZeroUserManager(
            CodeZeroRoleManager <TRole, TUser> roleManager,
            CodeZeroUserStore <TRole, TUser> store,
            IOptions <IdentityOptions> optionsAccessor,
            IPasswordHasher <TUser> passwordHasher,
            IEnumerable <IUserValidator <TUser> > userValidators,
            IEnumerable <IPasswordValidator <TUser> > passwordValidators,
            ILookupNormalizer keyNormalizer,
            IdentityErrorDescriber errors,
            IServiceProvider services,
            ILogger <UserManager <TUser> > logger,
            IPermissionManager permissionManager,
            IUnitOfWorkManager unitOfWorkManager,
            ICacheManager cacheManager,
            IRepository <OrganizationUnit, long> organizationUnitRepository,
            IRepository <UserOrganizationUnit, long> userOrganizationUnitRepository,
            IOrganizationUnitSettings organizationUnitSettings,
            ISettingManager settingManager)
            : base(
                store,
                optionsAccessor,
                passwordHasher,
                userValidators,
                passwordValidators,
                keyNormalizer,
                errors,
                services,
                logger)
        {
            _permissionManager              = permissionManager;
            _unitOfWorkManager              = unitOfWorkManager;
            _cacheManager                   = cacheManager;
            _organizationUnitRepository     = organizationUnitRepository;
            _userOrganizationUnitRepository = userOrganizationUnitRepository;
            _organizationUnitSettings       = organizationUnitSettings;
            _settingManager                 = settingManager;
            _optionsAccessor                = optionsAccessor;

            CodeZeroStore = store;
            RoleManager   = roleManager;
        }
        protected CodeZeroLogInManager(
            CodeZeroUserManager <TRole, TUser> userManager,
            IMultiTenancyConfig multiTenancyConfig,
            IRepository <TTenant> tenantRepository,
            IUnitOfWorkManager unitOfWorkManager,
            ISettingManager settingManager,
            IRepository <UserLoginAttempt, long> userLoginAttemptRepository,
            IUserManagementConfig userManagementConfig,
            IIocResolver iocResolver,
            CodeZeroRoleManager <TRole, TUser> roleManager)
        {
            MultiTenancyConfig         = multiTenancyConfig;
            TenantRepository           = tenantRepository;
            UnitOfWorkManager          = unitOfWorkManager;
            SettingManager             = settingManager;
            UserLoginAttemptRepository = userLoginAttemptRepository;
            UserManagementConfig       = userManagementConfig;
            IocResolver = iocResolver;
            RoleManager = roleManager;
            UserManager = userManager;

            ClientInfoProvider = NullClientInfoProvider.Instance;
        }
        protected CodeZeroUserManager(
            CodeZeroUserStore <TRole, TUser> userStore,
            CodeZeroRoleManager <TRole, TUser> roleManager,
            IPermissionManager permissionManager,
            IUnitOfWorkManager unitOfWorkManager,
            ICacheManager cacheManager,
            IRepository <OrganizationUnit, long> organizationUnitRepository,
            IRepository <UserOrganizationUnit, long> userOrganizationUnitRepository,
            IOrganizationUnitSettings organizationUnitSettings,
            ILocalizationManager localizationManager,
            IdentityEmailMessageService emailService,
            ISettingManager settingManager,
            IUserTokenProviderAccessor userTokenProviderAccessor)
            : base(userStore)
        {
            CodeZeroStore       = userStore;
            RoleManager         = roleManager;
            LocalizationManager = localizationManager;
            _settingManager     = settingManager;

            _permissionManager              = permissionManager;
            _unitOfWorkManager              = unitOfWorkManager;
            _cacheManager                   = cacheManager;
            _organizationUnitRepository     = organizationUnitRepository;
            _userOrganizationUnitRepository = userOrganizationUnitRepository;
            _organizationUnitSettings       = organizationUnitSettings;

            CodeZeroSession = NullCodeZeroSession.Instance;

            UserLockoutEnabledByDefault          = true;
            DefaultAccountLockoutTimeSpan        = TimeSpan.FromMinutes(5);
            MaxFailedAccessAttemptsBeforeLockout = 5;

            EmailService = emailService;

            UserTokenProvider = userTokenProviderAccessor.GetUserTokenProviderOrNull <TUser>();
        }