public RedisUserStore(ILdapService <TUser> authenticationService, IOptions <LdapConfig> config, ILogger <RedisUserStore <TUser> > logger)
        {
            _authenticationService = authenticationService;
            _logger = logger;

            InitializeRedis(config.Value.Redis, config.Value.RefreshClaimsInSeconds);
        }
Пример #2
0
 public AccountController(
     UserResolver <TUser> userResolver,
     UserManager <TUser> userManager,
     SignInManager <TUser> signInManager,
     IIdentityServerInteractionService interaction,
     IClientStore clientStore,
     IAuthenticationSchemeProvider schemeProvider,
     IEventService events,
     IEmailSender emailSender,
     IGenericControllerLocalizer <AccountController <TUser, TKey> > localizer,
     LoginConfiguration loginConfiguration,
     RegisterConfiguration registerConfiguration,
     ILdapService ldapService)
 {
     _userResolver          = userResolver;
     _userManager           = userManager;
     _signInManager         = signInManager;
     _interaction           = interaction;
     _clientStore           = clientStore;
     _schemeProvider        = schemeProvider;
     _events                = events;
     _emailSender           = emailSender;
     _localizer             = localizer;
     _loginConfiguration    = loginConfiguration;
     _registerConfiguration = registerConfiguration;
     _ldapService           = ldapService;
 }
Пример #3
0
 public SdsQueryExecutionBase(ILogger <SdsQueryExecutionBase> logger, ILdapService ldapService, IFhirApiService fhirApiService, IOptionsMonitor <Spine> spineOptionsDelegate)
 {
     _logger               = logger;
     _ldapService          = ldapService;
     _fhirApiService       = fhirApiService;
     _spineOptionsDelegate = spineOptionsDelegate;
 }
Пример #4
0
 public SendDbLobReminderRecipientGetterStrategy(
     NotificationDbContext notificationDbContext,
     ILdapService ldapService)
 {
     _notificationDbContext = notificationDbContext;
     _ldapService           = ldapService;
 }
 public AccountController(
     ILdapService ldapService,
     ILogger <AccountController> logger)
 {
     this._ldapService = ldapService;
     this._logger      = logger;
 }
Пример #6
0
        public AuthenticationService(
            IEntitiesContext entities, IAppConfiguration config, IDiagnosticsService diagnostics,
            IAuditingService auditing, IEnumerable <Authenticator> providers, ICredentialBuilder credentialBuilder,
            ICredentialValidator credentialValidator, IDateTimeProvider dateTimeProvider,
            ILdapService ldapService)
        {
            if (entities == null)
            {
                throw new ArgumentNullException(nameof(entities));
            }

            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            if (diagnostics == null)
            {
                throw new ArgumentNullException(nameof(diagnostics));
            }

            if (auditing == null)
            {
                throw new ArgumentNullException(nameof(auditing));
            }

            if (providers == null)
            {
                throw new ArgumentNullException(nameof(providers));
            }

            if (credentialBuilder == null)
            {
                throw new ArgumentNullException(nameof(credentialBuilder));
            }

            if (credentialValidator == null)
            {
                throw new ArgumentNullException(nameof(credentialValidator));
            }

            if (dateTimeProvider == null)
            {
                throw new ArgumentNullException(nameof(dateTimeProvider));
            }

            InitCredentialFormatters();

            Entities             = entities;
            _config              = config;
            Auditing             = auditing;
            _trace               = diagnostics.SafeGetSource("AuthenticationService");
            Authenticators       = providers.ToDictionary(p => p.Name, StringComparer.OrdinalIgnoreCase);
            _credentialBuilder   = credentialBuilder;
            _credentialValidator = credentialValidator;
            _dateTimeProvider    = dateTimeProvider;

            this.Ldap = ldapService;
        }
Пример #7
0
 public LdapServer(IOptions <LdapServerOptions> options, ILdapService ldapService, ILogger <LdapServer> logger)
 {
     _options             = options.Value;
     _ldapService         = ldapService;
     _logger              = logger;
     _tcpListener         = new TcpListener(_options.IpAdr, _options.Port);
     _ldapSessionStoreLst = new ConcurrentBag <LdapSession>();
 }
 public LdapUserManager(ILdapService ldapService, IUserStore <THUMember> store, IOptions <IdentityOptions> optionsAccessor,
                        IPasswordHasher <THUMember> passwordHasher, IEnumerable <IUserValidator <THUMember> > userValidators,
                        IEnumerable <IPasswordValidator <THUMember> > passwordValidators, ILookupNormalizer keyNormalizer,
                        IdentityErrorDescriber errors, IServiceProvider services, ILogger <LdapUserManager> logger)
     : base(store, optionsAccessor, passwordHasher, userValidators, passwordValidators,
            keyNormalizer, errors, services, logger)
 {
     this.ldapService = ldapService;
 }
        public RedisUserStore(
            ILdapService <TUser> authenticationService,
            ExtensionConfig ldapConfigurations,
            ILogger <RedisUserStore <TUser> > logger)
        {
            _authenticationService = authenticationService;
            _logger = logger;

            InitializeRedis(ldapConfigurations);
        }
 public LdapResourceOwnerPasswordValidator(
     UserManager <TUser> userManager,
     SignInManager <TUser> signInManager,
     IEventService events,
     ILogger <ResourceOwnerPasswordValidator <TUser> > logger,
     ILdapService ldapService) : base(userManager, signInManager, events, logger)
 {
     _ldapService = ldapService;
     _userManager = userManager;
     _events      = events;
 }
Пример #11
0
        //public UserService(
        //    IConfiguration config,
        //    ICryptographyService crypto,
        //    IEntityRepository<User> userRepository) : this()
        //{
        //    Config = config;
        //    Crypto = crypto;
        //    UserRepository = userRepository;
        //}

        public UserService(
            IConfiguration config,
            ICryptographyService crypto,
            IEntityRepository <User> userRepository,
            ILdapService ldapService)            : this()
        {
            Config           = config;
            Crypto           = crypto;
            UserRepository   = userRepository;
            this.ldapService = ldapService;
        }
Пример #12
0
        private void RunJobWithUser(IList<User> users, ILdapService ldapService)
        {
            var employeesCT = _contentManager.Query().ForType(Constants.CONTENTTYPENAME).List();
            var languages = cultureManager.ListCultures().ToList();

            foreach (var user in users)
            {
                var userId = Convert.ToBase64String(user.UserID);
                //get all employees with specified ID
                var orchardUsers = employeesCT.Where(contentItem => contentItem.Parts.Any(part => part.Fields.Any(f => (f.Name.ToLower() == Constants.EMPLOYEEIDFIELD.ToLower() && ((TextField)f).Value == userId)))).ToList();

                //get "main" employee - in default language
                var orchardUser = orchardUsers.FirstOrDefault(u => u.As<LocalizationPart>().Culture == null || u.As<LocalizationPart>().Culture.Culture == Constants.DEFAULTADLANGUAGE);
                //todo: oddelit jednotlive vytarania, kontrolovat ci uz neexistuje user, orchardUser je employee
                if (orchardUser == null)
                {
                    try
                    {
                        orchardUser = CreateUser(ldapService, user, null, Constants.DEFAULTADLANGUAGE);
                        if (orchardUsers.Count > 0)
                        {
                            SetParent(orchardUser, orchardUsers);
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(string.Format("Nastala chyba pri vytvarani pouzivatela {0} v orcharde.", user.LoginName), ex);
                    }
                }
                else
                {
                    try
                    {
                        UpdateUser(orchardUser, user, orchardUsers);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(string.Format("Nastala chyba pri aktualizacii udajov pouzivatela: {0}", user.LoginName), ex);
                    }
                }

                //check and create if exist employees im other language variations

                try
                {
                    CheckAllUserLanguageVariantions(orchardUser, orchardUsers, languages, user);
                }
                catch (Exception ex)
                {
                    throw new Exception(string.Format("Nastala chyba pri kontrole jazykovych variantov: {0}", user.LoginName), ex);
                }
            }
        }
Пример #13
0
 public JobImportLdapUsers(ClientManager clientManager,
                           DirectoryManager directoryManager,
                           ILdapService <LdapUser> ldapService,
                           ISyncService <User, LdapUser> syncService,
                           UserManager userManager)
 {
     _clientManager    = clientManager;
     _directoryManager = directoryManager;
     _userManager      = userManager;
     _ldapService      = ldapService;
     _syncService      = syncService;
 }
 public NovellActiveDirectoryAuthenticationController(NovellActiveDirectoryExternalAuthSettings novellActiveDirectoryExternalAuthSettings, IExternalAuthenticationService externalAuthenticationService, ILocalizationService localizationService, IPermissionService permissionService, ISettingService settingService, ICustomerService customerService, IAuthenticationService authenticationService, IShoppingCartService shoppingCartService, IWorkContext workContext, IEventPublisher eventPublisher, ICustomerActivityService customerActivityService, IStaticCacheManager cacheManager, INotificationService notificationService, ILdapService ldapService, IStoreService storeService, IStoreContext storeContext, IAuthenticationPluginManager authenticationPluginManager)
 {
     _novellActiveDirectoryExternalAuthSettings = novellActiveDirectoryExternalAuthSettings;
     _externalAuthenticationService             = externalAuthenticationService;
     _localizationService         = localizationService;
     _permissionService           = permissionService;
     _settingService              = settingService;
     _workContext                 = workContext;
     _customerActivityService     = customerActivityService;
     _notificationService         = notificationService;
     _ldapService                 = ldapService;
     _storeService                = storeService;
     _storeContext                = storeContext;
     _authenticationPluginManager = authenticationPluginManager;
 }
Пример #15
0
 public SearchModel(IConfiguration configuration, IHttpContextAccessor contextAccessor, ILogger <SearchModel> logger, ILdapService ldapService, ITokenService tokenService, IGpConnectQueryExecutionService queryExecutionService, IApplicationService applicationService, IAuditService auditService, ILoggerManager loggerManager = null)
 {
     _configuration         = configuration;
     _contextAccessor       = contextAccessor;
     _logger                = logger;
     _ldapService           = ldapService;
     _tokenService          = tokenService;
     _queryExecutionService = queryExecutionService;
     _applicationService    = applicationService;
     _auditService          = auditService;
     if (null != loggerManager)
     {
         _loggerManager = loggerManager;
     }
 }
 public AdminController(ILogger <AdminController> logger,
                        UserManager <User> userManager,
                        RoleManager <Role> roleManager,
                        IAuthorizationService authorizationService,
                        ILdapService ldapService,
                        IAppSettingsManager appSettingsManager,
                        INotificationRulesManager rulesManager)
 {
     _logger               = logger;
     _userManager          = userManager;
     _roleManager          = roleManager;
     _authorizationService = authorizationService;
     _ldapService          = ldapService;
     _appSettingsManager   = appSettingsManager;
     _rulesManager         = rulesManager;
 }
Пример #17
0
 public SearchDetailModel(IOptionsMonitor <General> configuration, IHttpContextAccessor contextAccessor, ILogger <SearchDetailModel> logger, ILdapService ldapService, ITokenService tokenService, IGpConnectQueryExecutionService queryExecutionService, IApplicationService applicationService, IAuditService auditService, IReportingService reportingService, ILoggerManager loggerManager = null) : base(configuration, contextAccessor, reportingService)
 {
     _configuration         = configuration;
     _contextAccessor       = contextAccessor;
     _logger                = logger;
     _ldapService           = ldapService;
     _tokenService          = tokenService;
     _queryExecutionService = queryExecutionService;
     _applicationService    = applicationService;
     _auditService          = auditService;
     _reportingService      = reportingService;
     if (null != loggerManager)
     {
         _loggerManager = loggerManager;
     }
 }
Пример #18
0
 public RemoteTaskService(IHardwareVaultService hardwareVaultService,
                          IHardwareVaultTaskService hardwareVaultTaskService,
                          IAccountService accountService,
                          IDataProtectionService dataProtectionService,
                          ILdapService ldapService,
                          IAppSettingsService appSettingsService,
                          ISynchronizationService synchronizationService)
 {
     _hardwareVaultService     = hardwareVaultService;
     _hardwareVaultTaskService = hardwareVaultTaskService;
     _accountService           = accountService;
     _dataProtectionService    = dataProtectionService;
     _ldapService            = ldapService;
     _appSettingsService     = appSettingsService;
     _synchronizationService = synchronizationService;
 }
Пример #19
0
        public AuthenticationService(IEntitiesContext entities, IAppConfiguration config, IDiagnosticsService diagnostics, AuditingService auditing, IEnumerable<Authenticator> providers, ILdapService ldapService)
        {
            _credentialFormatters = new Dictionary<string, Func<string, string>>(StringComparer.OrdinalIgnoreCase) {
                { "password", _ => Strings.CredentialType_Password },
                { "apikey", _ => Strings.CredentialType_ApiKey },
                { "external", FormatExternalCredentialType }
            };

            Entities = entities;
            _config = config;
            Auditing = auditing;
            _trace = diagnostics.SafeGetSource("AuthenticationService");
            Authenticators = providers.ToDictionary(p => p.Name, StringComparer.OrdinalIgnoreCase);

            this.Ldap = ldapService;
        }
Пример #20
0
 /// <summary>
 /// Конструктор <see cref="TaskCreateService"/>.
 /// </summary>
 /// <param name="jira_api_service">Сервис для работы с JIRA.</param>
 /// <param name="ldap_service">Сервис Ldap.</param>
 /// <param name="task_repository">Репозиторий типов задач.</param>
 /// <param name="workflow_repository">Репозиторий для работы с процессами <see cref="Workflow"/>.</param>
 /// <param name="role2_workflow_repository">Репозиторий для работы со связями роли и процесса <see cref="Role2Workflow"/>.</param>
 /// <param name="product_repository">Репозиторий для работы с товаром <see cref="Product"/>.</param>
 /// <param name="exploration_repository">Репозиторий для работы с исследованиями <see cref="Exploration"/>.</param>
 /// <param name="perimeter_repository">Репозиторий для работы с периметром <see cref="Perimeter"/>.</param>
 public TaskCreateService(
     IJiraApiService jira_api_service,
     ILdapService ldap_service,
     IBaseConfigurationRepository <Task> task_repository,
     IBaseConfigurationRepository <Workflow> workflow_repository,
     IBaseConfigurationRepository <Role2Workflow> role2_workflow_repository,
     IBaseConfigurationRepository <Product> product_repository,
     IBaseConfigurationRepository <Exploration> exploration_repository,
     IBaseConfigurationRepository <Perimeter> perimeter_repository)
 {
     _jiraApiService          = jira_api_service;
     _ldapService             = ldap_service;
     _taskRepository          = task_repository;
     _workflowRepository      = workflow_repository;
     _role2WorkflowRepository = role2_workflow_repository;
     _productRepository       = product_repository;
     _explorationRepository   = exploration_repository;
     _perimeterRepository     = perimeter_repository;
 }
Пример #21
0
        public SignInManager(
            UserManager userManager,
            DirectoryManager directoryManager,
            ClaimsFactory claimsFactory,
            PasswordHasher passwordHasher,
            TenantManager tenantManager,
            IOptions <IdentityOptions> optionsAccessor,
            ILogger <SignInManager> logger,
            ILdapService <LdapUser> ldapService,
            ISyncService <User, LdapUser> syncService,
            IHttpContextAccessor httpContextAccessor
            )
            : base(userManager, httpContextAccessor, claimsFactory, optionsAccessor, logger)
        {
            UserManager = userManager;

            _tenantManager    = tenantManager;
            _directoryManager = directoryManager;
            _ldapService      = ldapService;
            _syncService      = syncService;
            _passwordHasher   = passwordHasher;
        }
Пример #22
0
 public RequestController(
     IEmployeeRepository employeeRepo,
     IResourceRepository resourceRepo,
     IRequestRepository repo,
     IAccessRoleRepository roleRepo,
     ILdapService ldapSrv,
     HistoryService historySrv,
     ApplicationDbContext ctx,
     OTRSService otrsServ,
     ILogger <RequestController> log,
     NotificationService notifService)
 {
     employeeesRepository = employeeRepo;
     resourcesRepository  = resourceRepo;
     roleRepository       = roleRepo;
     repository           = repo;
     ldapService          = ldapSrv;
     historyService       = historySrv;
     context           = ctx;
     logger            = log;
     otrsService       = otrsServ;
     this.notifService = notifService;
 }
Пример #23
0
        /// <summary>
        /// Creates the user.
        /// </summary>
        /// <param name="ldapService">The LDAP service.</param>
        /// <param name="user">The user.</param>
        /// <param name="parentContentItem">The parent content item.</param>
        /// <param name="language">The language.</param>
        /// <returns></returns>
        private ContentItem CreateUser(ILdapService ldapService, User user, ContentItem parentContentItem, string language)
        {
            var orchardUser = CreateEmployee(user, parentContentItem, language);
            if (orchardUser == null)
            {
                Logger.Error("An error occured during creating employee: {0}, in DirectoryServices module!", user.Surname);
            }
            if (originalMembershipService.Value.GetUser(user.LoginName) == null)
            {
                if (!CreateNewUser(ldapService, user))
                {
                    Logger.Error("An error occurred during creating user: {0}, in ADModule.", user.Surname);
                }
            }

            return orchardUser;
        }
Пример #24
0
 public UserManager(IGenericDAO<UserProfile> userProfileDAO, ILdapService ldapService)
 {
     _userProfileDAO = userProfileDAO;
     _ldapService = ldapService;
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="DepartmentConsumer" /> class.
 /// </summary>
 /// <param name="ldapService">The LDAP service.</param>
 public DepartmentConsumer(ILdapService ldapService)
 {
     Contract.Requires(ldapService != null);
     _ldapService = ldapService;
 }
Пример #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SecurityManager"/> class.
 /// </summary>
 public SecurityManager()
 {
     // TODO: Implement DI
     ldapServiceClient = new LdapServiceClient();
 }
Пример #27
0
 /// <summary>
 /// Creates the new user.
 /// </summary>
 /// <param name="ldapService">The LDAP service.</param>
 /// <param name="item">The item.</param>
 /// <returns></returns>
 private bool CreateNewUser(ILdapService ldapService, User item)
 {
     var pass = RandomString(10);
     var user = originalMembershipService.Value.CreateUser(new CreateUserParams(item.LoginName, pass, null, null, null, true));
     if (user != null)
     {
         user.As<UserLdapPart>().LdapDirectoryId = ldapService.Directory.Id;
         return true;
     }
     return false;
 }
Пример #28
0
 public HistoryService(ApplicationDbContext ctx, ILdapService ldapSrv)
 {
     context     = ctx;
     ldapService = ldapSrv;
 }
 public ErrorModel(IConfiguration configuration, IHttpContextAccessor contextAccessor, ILogger <ErrorModel> logger, ILdapService ldapService)
 {
     _logger = logger;
 }
Пример #30
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InMemoryUserStore{TUser}"/> class.
 /// </summary>
 /// <param name="authenticationService">The authentication service.</param>
 public InMemoryUserStore(ILdapService <TUser> authenticationService)
 {
     _authenticationService = authenticationService;
 }
Пример #31
0
 bool AuthenticateWith(ILdapService ldapService, string userName, string password)
 {
     try
     {
         return ldapService.Authenticate(userName, password);
     }
     catch (Exception ex)
     {
         Logger.Error("An error occurred during authentication. Details: {0}", ex);
         return false;
     }
 }
Пример #32
0
 public LdapAuthenticationService(ILdapService ldapService)
 {
     _ldapService = ldapService;
 }
Пример #33
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SecurityManager"/> class.
 /// </summary>
 public SecurityManager()
 {
     // TODO: Implement DI
     ldapServiceClient = new LdapServiceClient();
 }
Пример #34
0
 /// <inheritdoc />
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ldapService"></param>
 protected BaseLdapUserManager(
     ILdapService <TLdapUser> ldapService)
 {
     LdapService = ldapService;
 }
Пример #35
0
 public AccountController(ILdapService authService, IEmployeeRepository repo)
 {
     _authService = authService;
     repository   = repo;
 }
Пример #36
0
 public LdapTokenService(IServiceProvider serviceProvider)
 {
     _ldapService        = serviceProvider.GetRequiredService <ILdapService>();
     _logger             = serviceProvider.GetService <ILogger <LdapTokenService> >() ?? NullLogger <LdapTokenService> .Instance;
     _applicationService = serviceProvider.GetRequiredService <IApplicationService>();
 }
Пример #37
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="UserGroupConsumer" /> class.
 /// </summary>
 /// <param name="ldapService">The LDAP service.</param>
 public UserGroupConsumer(ILdapService ldapService)
 {
     Contract.Requires(ldapService != null);
     _ldapService = ldapService;
 }
Пример #38
0
        private void Init()
        {
            _userProfileDAO = new GenericDAO<UserProfile>();
               _gameStockConfig = new StockGameConfiguration();
               _orderDAO = new GenericDAO<Order>();
               _instrumentDAO = new GenericDAO<Instrument>();
               _instrumentHistoryDAO = new GenericDAO<InstrumentHistory>();
               _alertDAO = new GenericDAO<Alert>();
               _instrumentRepository = new InstrumentRepository(_instrumentDAO, _instrumentHistoryDAO);
               _orderRepository = new OrderRepository(_orderDAO,_instrumentDAO);
               _alertRepository = new AlertRepository(_alertDAO, _instrumentDAO);
               _ldapService = new FakeLdapService(_gameStockConfig);
               _ldapService.Init();

               _notificationtDAO = new GenericDAO<Notification>();
               _notificationRepository = new NotificationRepository(_notificationtDAO);
               _notificationManager = new NotificationManager(_notificationRepository);
               _alertManager = new AlertManager(_notificationManager, _alertRepository);
               _userManager = new UserManager(_userProfileDAO, _ldapService);

               _alertService = new AlertService(_orderRepository, _instrumentRepository, _alertRepository, _alertManager);
        }