protected virtual async Task <LdapConnection> CreateLdapConnection(Tenant tenant) { var ldapConnection = new LdapConnection(); ldapConnection.Connect(await _settings.GetDomain(tenant?.Id), await _settings.GetPort(tenant?.Id)); ldapConnection.Bind(await _settings.GetUserName(tenant?.Id), await _settings.GetPassword(tenant?.Id)); return(ldapConnection); }
protected virtual async Task <PrincipalContext> CreatePrincipalContext(TTenant tenant) { return(new PrincipalContext( await _settings.GetContextType(tenant?.Id), ConvertToNullIfEmpty(await _settings.GetDomain(tenant?.Id)), ConvertToNullIfEmpty(await _settings.GetContainer(tenant?.Id)), ConvertToNullIfEmpty(await _settings.GetUserName(tenant?.Id)), ConvertToNullIfEmpty(await _settings.GetPassword(tenant?.Id)) )); }