code: public void checkCredentials() throws IOException, MediaWikiApiErrorException {
  		Map<String,String> parameters = new HashMap<>();
  		parameters.put("action", "query");
  		sendJsonRequest("POST", parameters);
  	}
docs: Checks that the credentials are still valid for the
  user currently logged in. This can fail if (for instance)
  the cookies expired, or were invalidated by a logout from
  a different client.
  
  This method queries the API and throws {@class AssertUserFailedException}
  if the check failed. This does not update the state of the connection
  object.
  @throws MediaWikiApiErrorException
  @throws IOException