private IEnumerable <string> GetRolesForUserWithoutMembershipAttribute(string username) { using (var entry = userEntryAdapter.GetUserEntry(username)) { var results = groupEntryAdapter.GetGroupsWithEntryAsMemebership(entry); foreach (var result in results) { yield return(groupEntryAdapter.GetGroupName(result)); } } }
public override bool ValidateUser(string username, string password) { try { using (var user = userEntryAdapter.GetUserEntry(username, password)) { return(user.GetProperties(usersConfig.RdnAttribute).Any()); } } catch (Exception ex) { log.Debug(c => c(string.Format("Failed to validate user '{0}'.", username), ex)); } return(false); }