@Override
	public void handleIt(Object... args) {

		while (!authentication) {
			Scanner input = new Scanner(System.in);

			// Getting authentication information from user
			System.out.print("Please enter your username: ");
			userName = input.next();

			System.out.print("Please enter your password: ");
			userPassword = input.next();

			// Creating an authentication object based on user input
			authObject = new AuthenticationBean(userName, userPassword);

			// Getting socket and user from passed arguments
			Socket sock = (Socket) args[0];
			User currentUser = (User) args[1];

			try {
				// Constructing input and output streams
				JSONOutputStream jsonOut = new JSONOutputStream(sock.getOutputStream());

				// Writing command object to server
				jsonOut.writeObject(authObject);
				// Reading response from server
				int success = sock.getInputStream().read();
				
				// If authentication is successful 
				if (success == 1) {
					authentication = true;
					currentUser.setUsername(userName);
					currentUser.setPassword(userPassword);
					currentUser.setLoggedIn(true);
				} else if(success == 0){
					System.out.println("\nAuthentication unsuccessful, please check user credentials\n");
				} else {
					System.out.println("Something went wrong...");
				}

			} catch (IOException e) {
				e.printStackTrace();
			} catch (JSONException e) {
				e.printStackTrace();
			}
		}
	}