public virtual IEntryCollection GetGroupsWithEntryAsMemebership(IEntry membershipEntry) { if (membershipEntry == null) { throw new ArgumentNullException("membershipEntry"); } using (var entry = GetGroupEntry()) { var searcher = GetGroupSearcher(entry, SearchScope.Subtree); var mebershipValue = nameParser.GetDn(membershipEntry.Path); searcher.Filter = filterBuilder.AttachFilter(groupConfig.MembershipAttribute, mebershipValue, groupConfig.Filter); return(searcher.FindAll()); } }
public virtual IEntry GetUserEntry(string username, string password) { using (var user = GetUserEntry(username)) { if (!user.IsBound()) { return(null); } var userAsDn = nameParser.GetDn(user.Path); var uri = new Uri(configuration.Server.Url, userAsDn); var authenticatedUser = directoryEntryAdapter.GetEntry(uri, userAsDn, password); return(GetUserEntryFromSearcher(authenticatedUser)); } }