public void Setup() { var appSettings = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location).AppSettings; if (!appSettings.Settings.AllKeys.Contains("LdapUserPassword")) { _connection = new LdapServerConnection { Server = appSettings.Settings["LdapServer"].Value }; } else { _connection = new LdapServerConnection { Server = appSettings.Settings["LdapServer"].Value, Credentials = new System.Net.NetworkCredential(appSettings.Settings["LdapUserName"].Value, appSettings.Settings["LdapUserPassword"].Value, appSettings.Settings["LdapUserDomain"].Value) }; } _connectionManager = new LdapConnectionManager(_connection); }
public bool ValidateAuthentication(string login, string password) { LdapConnectionManager lcm = LdapConnectionManager.Instance; return(lcm.ValidateAuthentication(login, password)); }