private bool ValidateUsernameToken(UsernameToken token) { DatabaseConfigurationHandler databaseConfigManager = new DatabaseConfigurationHandler(); DatabaseConfiguration databaseConfiguration = (DatabaseConfiguration)databaseConfigManager.Load("serviceDatabaseConfiguration",string.Empty); UserDatabaseManager userDatabase = new UserDatabaseManager(); string password = userDatabase.GetPasswordToken(databaseConfiguration.ConnectionString,token.Username); if ( password.Length == 0 ) { return false; } else { if ( HashPassword(token.Username, password) == token.Password ) { return true; } else { return false; } } }
/// <summary> /// Creates a new QueryService. /// </summary> public LicenseServices() { // Load the account database. userDatabaseManager = new UserDatabaseManager(GetDatabaseConfiguration.ConnectionString); }