@Override
  public void startListening() throws HiveJdbcBrowserException {
    webServer = new Server();
    ServerConnector serverConnector = new ServerConnector(webServer);
    serverConnector.setHost(HiveSamlUtils.LOOP_BACK_INTERFACE);
    serverConnector.setPort(portFromUrl);
    LOG.info("Browser response timeout is set to {} ms", timeoutInMs);
    serverConnector.setIdleTimeout(timeoutInMs);
    webServer.addConnector(serverConnector);
    ServletHandler servletHandler = new ServletHandler();
    servletHandler.addServletWithMapping(
        new ServletHolder(new HttpBrowserClientServlet(this)), "/");
    webServer.setHandler(servletHandler);
    webServer.setStopTimeout(30*1000L);
    try {
      webServer.start();
      // we fetch the port after the server is started so that we can get the port
      // where the server has bound in case there is no port specified from the URL.
      serverPort = ((ServerConnector) webServer.getConnectors()[0]).getLocalPort();
      LOG.debug("Listening on the port {} ", serverPort);
    } catch (Exception e) {
      throw new HiveJdbcBrowserException("Could not start http server", e);
    }
  }
This class is used to execute a browser based SSO workflow with the authentication mode
is browser.
jdbc/src/java/org/apache/hive/jdbc/saml/HiveJdbcBrowserClient.java