public bool Authenticate(string username, string password = null) { var userResponse = _connection.AuthInfoUser(username); if (userResponse.Code == 281) { return(true); } if (userResponse.Code != 381 || password == null) { return(false); } var passResponse = _connection.AuthInfoPass(password); return(passResponse.Code == 281); }