code: private void returnToBrowser(Socket socket) throws IOException
    {
      PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
  
      List<String> content = new ArrayList<>();
      content.add("HTTP/1.0 200 OK");
      content.add("Content-Type: text/html");
      String responseText;
      if (this.origin != null)
      {
        content.add(
            String.format("Access-Control-Allow-Origin: %s", this.origin));
        content.add("Vary: Accept-Encoding, Origin");
        Map<String, Object> data = new HashMap<>();
        data.put("consent", this.consentCacheIdToken);
        responseText = mapper.writeValueAsString(data);
      }
      else
      {
        responseText =
            "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"/>" +
            "<title>SAML Response for Snowflake</title></head>" +
            "<body>Your identity was confirmed and propagated to " +
            "Snowflake JDBC driver. You can close this window now and go back " +
            "where you started from.</body></html>";
  
      }
      content.add(String.format("Content-Length: %s", responseText.length()));
      content.add("");
      content.add(responseText);
  
      for (int i = 0; i < content.size(); ++i)
      {
        if (i > 0)
        {
          out.print("\r\n");
        }
        out.print(content.get(i));
      }
      out.flush();
    }
docs: Output the message to the browser
  
  @param socket client socket
  @throws IOException if any IO error occurs