code: @Deprecated
  	public void login(String username, String password)
  			throws LoginFailedException {
  		try {
  			String token = fetchToken("login");
  			try {
  				this.confirmLogin(token, username, password);
  			} catch (NeedLoginTokenException e) { // try once more
  				token = fetchToken("login");
  				this.confirmLogin(token, username, password);
  			}
  		} catch (IOException | MediaWikiApiErrorException e1) {
  			throw new LoginFailedException(e1.getMessage(), e1);
  		}
  	}
docs: Logs in using the specified user credentials. After successful login, the
  API connection remains in a logged in state, and future actions will be
  run as a logged in user.
  
  @param username
  the name of the user to log in
  @param password
  the password of the user
  @throws LoginFailedException
  if the login failed for some reason